Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to install my ubuntu using the downloaded jdk1.7.0_11 and jre1.7.0_11,and i traced the questions from here and followed tat steps even it is not installing the java. In the terminal , I am getting an error like this

Selection    Path                               Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/jre1.7.0_11/bin/java   3         auto mode
  1            /usr/lib/jvm/jdk1.7.0_11/bin/java   1         manual mode
  2            /usr/lib/jvm/jre1.7.0_11/bin/java   3         manual mode


Press enter to keep the current choice[*], or type selection number: 0
update-alternatives: warning: forcing reinstallation of alternative /usr/lib/jvm/jre1.7.0_11/bin/java because link group java is broken.
update-alternatives: warning: not replacing /usr/bin/java with a link.

pls guide me to work it possible to install java

Thank you

share|improve this question
    
Its not an error message. its process of installation asking you to give the choice, you need to select the option that corresponds to your package. And that is the final step of installation, there after you could give $ java --version in terminal to check what you have installed. –  VRU Jan 17 '13 at 11:00
    
i even tried tat by giving one of those options ,but i couldnt able to see the installed version of java by using the java --version,i am getting The program 'java' can be found in the following packages: * default-jre * gcj-4.6-jre-headless * openjdk-6-jre-headless * gcj-4.5-jre-headless * openjdk-7-jre-headless Try: sudo apt-get install <selected package> so i gave sudo apt-get install with the above packages it shows error as sridhar@sridhar-Satellite-A305:~$ sudo apt-get openjdk-6-jre-headless E: Invalid operation openjdk-6-jre-headless –  Sridhar Ramakrishnan Jan 18 '13 at 6:39
    
forgot to ask you, have you tried it from Ubuntu Software Center? –  VRU Jan 18 '13 at 7:27
    
yes that also i tried but its not installing :( –  Sridhar Ramakrishnan Jan 18 '13 at 8:53
add comment

2 Answers 2

In my system I have installed OpenJDK in offline mode and it went successful. I am sharing you the same. Before you start, remove all old files so that you don't get in to any confusion and start with any one i.e., either JDK or JRE.

Installation of OpenJDK on Ubuntu :

1) Download OpenJDK

2) Extract the tar file.(using any of the two steps)

      Right click on the .tar file and select Extract Here.

      or open Terminal and give the command tar –xzf <filename>

example:

           $ tar xzf jdk-7u7-linux-i586.tar.gz

3) Move the extracted file to the “/usr/lib/jvm/” folder: [Note: If you don’t find a jvm folder in /usr/lib/ path , create a jvm folder there: $ sudo mkdir –p /usr/lib/jvm/]

           $ sudo mv jdk1.7.0_07 /usr/lib/jvm/

4) Install in your system :

           $ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_07/bin/javac 1

5) That’s it. Test your Java :

           $ java -version 

Remember to replace the file name with the one you have downloaded.

share|improve this answer
    
oops !!! it doesnt work for me /# sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_11/bin/javac 1 /# java -version The program 'java' can be found in the following packages: * default-jre * gcj-4.6-jre-headless * openjdk-6-jre-headless * gcj-4.5-jre-headless * openjdk-7-jre-headless Try: apt-get install <selected package> –  Sridhar Ramakrishnan Jan 18 '13 at 11:24
    
nothing come...for ex: Empty directory with -ls command means wat would happen likewise printing again that ...this was happened 4th step :( –  Sridhar Ramakrishnan Jan 18 '13 at 11:41
    
ok i will try im having that tar file also ...have to do same once again right?? –  Sridhar Ramakrishnan Jan 18 '13 at 11:49
    
actually my main aim is to install eclipse in ubuntu but it is asking me to download java so nly im doing –  Sridhar Ramakrishnan Jan 18 '13 at 11:51
    
Yes. Even I have installed Open JDK for installing Eclipse on my machine, and I have done everything off-line. –  VRU Jan 18 '13 at 11:52
show 3 more comments

As VRU said it is not an error, it is a selection. It appears when more than one version of a program is installed. In this case you can select which Java version is used to execute Java programs.

The top one is the presently selected. Below that all the options are listed. In this case you can choose between the JRE and the JDK. JRE is the Java Runtime Environment and is usually fine for running all Java programs. JDK is the Java Development Kit. It is mainly needed to compile Java programs. Some programming tools require to be run with the JDK instead of JRE. If you are not developing programs in Java, selecting the JRE is fine.

If you had Java 6 (or 5) installed alongside with Java 7, it would also appear in this list.

You can check the version using java --version. The selection can be changed later on with sudo update-java-alternatives. Try forcing this.

If it doesn't work reinstall the java packages. If you are not developing Java you could also remove the JDK entirely, making the selection obsolete.

share|improve this answer
    
i even tried tat by giving one of those options ,but i couldnt able to see the installed version of java by using the java --version,i am getting The program 'java' can be found in the following packages: * default-jre * gcj-4.6-jre-headless * openjdk-6-jre-headless * gcj-4.5-jre-headless * openjdk-7-jre-headless Try: sudo apt-get install <selected package> so i gave sudo apt-get install with the above packages it shows error as sridhar@sridhar-Satellite-A305:~$ sudo apt-get openjdk-6-jre-headless E: Invalid operation openjdk-6-jre-headless –  Sridhar Ramakrishnan Jan 18 '13 at 6:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.