Thursday, 14 February 2008

Java Ubuntu alternative option

7 Multiple JRE/JDK installed


If you have multiple JRE or JDK installed (e.g. 1.5.0 and 1.4.2) and want/need to switch between them, you can use update-alternatives to do so.

Example: Choosing which java executable to use:

update-alternatives --config java

Example: Choosing which javac executable to use:

update-alternatives --config javac

And so on in that fashion for the remaining executables related to Java. You can look in /etc/alternatives to see what one can configure with update-alternatives.

If you wish to remove some of the JRE/JDKs you have installed, execute (example: for Sun JRE 1.4.2):

apt-get remove sun-j2re1.4

Powered by ScribeFire.

No comments:

My photo
London, United Kingdom

Facebook & Twitter