Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am facing a problem while trying to install Java 7 on Ubuntu.

The following are the steps that I performed for installing:

I installed the setup file from the link given below:

wget http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-x64.tar.gz

  1. I have a file: jdk-7u1-linux-x64.tar.gz

  2. I Untared it:

    tar -xvf jdk-7u1-linux-x64.tar.gz

  3. sudo mv ./jdk1.7.0_01 /usr/lib/jvm/jdk1.7.0_01

  4. sudo update-alternatives –config java Here it gave me the following output:

    There is only one alternative in link group java: /usr/lib/jvm/java-6-sun/jre/bin/java Nothing to configure.

  5. sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_01/jre/bin/java 1(I entered 1 here.)

  6. sudo update-alternatives --config java

  7. java -version.

It showed the following output

java version "1.6.0_26"

Java(TM) SE Runtime Environment (build 1.6.0_26-b03)

Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

I am not sure if jdk1.7.0 is installed as its showing the version as 1.6.0_26.

share|improve this question
    
ideally the method described above should work like this: shinephp.com/install-jdk-7-on-ubuntu otherwise try this: webupd8.org/2011/09/how-to-install-oracle-java-7-jdk-in.html – zengr Dec 17 '11 at 10:16
    

this will install the new jvm into the java link group

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_01/bin/java 1

then, when you run this command again, you will see the list of JVMs that you are expecting.

sudo update-alternatives --config java
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .