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?
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?
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.
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.