tags:

views:

1469

answers:

2

I need to downgrade Java in Ubuntu. Current version is 1.6.0, I have to use JDK 1.5.0 for my Android platform.

How to do it? Remove it and reinstall?

+4  A: 

update-java-alternatives is 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 Java version you want. E.g., to seletc Java 1.5, do

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

Make sure first that you have the correct Java packages installed.

See the Ubuntu Java page for more details.

lindelof
A: 

Back in the stone age (2000-2001) on Solaris we'd install both versions side by side (/usr/local or /opt) and have a bash script to change JAVA_HOME to the version we wanted to use. Easy peasy. Just make sure JAVA_HOME is in your PATH and possibly your LD_LIBRARY_PATH.

Mike Reedell