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 using Ubuntu version 12.04 (via VM)

I downloaded and installed java:

sudo apt-get install python-software-properties
sudo add-apt-repository "deb lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

The version is:

java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.4) (6b24-1.11.4-1ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

But I need the version:

java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.13) (6b20-1.9.13-0ubuntu1~10.04.1)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

How can I download and install sun-java6-jdk version 1.6.0_20?
Thanks in advance

share|improve this question

migrated from Oct 5 '12 at 3:54

This question came from our site for professional and enthusiast programmers.

For installing the particular version of sun java run:

sudo apt-get install sun-java6-jdk=1.6.0_20

Then to choose the default java installation run the following and choose the correct installation:

sudo update-alternatives --config java
share|improve this answer
I get this: Reading package lists... Done Building dependency tree Reading state information... Done E: Version '1.6.0_20' for 'sun-java6-jdk' was not found – Bla bla Oct 4 '12 at 17:04
It appears the sun java packages are not present in the ubuntu repos anymore. Follow the instructions here to get and install them from alternative locations. – Abhinav Sarkar Oct 4 '12 at 17:11


sudo update-alternatives --config java

Source: Ubuntu Community Wiki.

share|improve this answer
I get this: There is only one alternative in link group java: /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java Nothing to configure. – Bla bla Oct 4 '12 at 17:03

You must log in to answer this question.