How can I downgrade Java from 1.6.0 to 1.5.0 in Ubuntu?

I need to downgrade Java in Ubuntu. The current version is 1.6.0, I have to use JDK 1.5.0 for the Android platform.

How to do it? Uninstall it and reinstall it?

+3
source share
3 answers

update-java-alternatives - your friend:

$ sudo update-java-alternatives -l
java-1.5.0-sun 53 /usr/lib/jvm/java-1.5.0-sun
java-6-sun 63 /usr/lib/jvm/java-6-sun

Then select the desired version of Java. For example, for seletc Java 1.5, do

$ sudo update-java-alternatives -s java-1.5.0-sun

First, make sure you have the correct Java packages installed.

See the Ubuntu Java page for more details .

+7
source

Late answer, but it might help someone:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy main multiverse"
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu hardy-updates main multiverse"
sudo apt-get update
sudo apt-get install sun-java5-jdk

then you can see java5 when you

sudo update-java-alternatives -l
+8
source

In the Stone Age (2000-2001) on Solaris, we installed both versions side by side (/ usr / local or / opt) and suggested a bash script to change JAVA_HOME to the desired version to use. Very simple. Just make sure JAVA_HOME is in your PATH and possibly LD_LIBRARY_PATH.

0
source

All Articles