Tuesday 28 October 2008

Choosing which version of Java JRE system should use

Sometimes a number of various Java Runtime Environment versions is needed to be installed on a Linux system. To chose which one to use as a default use this command:

sudo update-alternatives --config java


An output like this will show up:

There are 6 alternatives which provide `java'.

Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-4.3
2 /usr/lib/jvm/java-gcj/jre/bin/java
3 /usr/lib/jvm/java-6-sun/jre/bin/java
* 4 /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
+ 5 /usr/lib/jvm/java-6-openjdk/jre/bin/java
6 /usr/bin/gij-4.2

Press enter to keep the default[*], or type selection number:


All to do here is enter the number of the selection next to the alternative JRE name and press enter.

Hope this was helpful. Enjoy.

No comments: