3


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 http://archive.canonical.com/ 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

0

2 Answers 2

1

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
2
  • 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, 2012 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. Oct 4, 2012 at 17:11
0

Try:

sudo update-alternatives --config java

Source: Ubuntu Community Wiki.

1
  • 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, 2012 at 17:03

You must log in to answer this question.