Joe Ho
Joe Ho

Reputation: 928

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

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?

Upvotes: 3

Views: 11430

Answers (3)

esharp
esharp

Reputation: 1317

Late answer but it may help someone out there:

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

Upvotes: 8

Mike Reedell
Mike Reedell

Reputation: 1587

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.

Upvotes: 0

lindelof
lindelof

Reputation: 35250

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.

Upvotes: 7

Related Questions