Eric D. Schabell: Fedora 10 adding new java version 6 (1.6) to alternatives

Wednesday, June 3, 2009

Fedora 10 adding new java version 6 (1.6) to alternatives

I have posted in the past on how to switch from one version to another in the alternatives system.

This time I want to add a new version of Java to the list of alternatives you can choose from, this you do as follows:

# unpack you java version and place it in /usr/lib/jvm/
#
$ mv jre1.6.0_13 /usr/lib/jvm/

# this shows the list of possible java installation
# but you don't yet see the above one listed:
#
$ update-alternatives --config java

# so we add it.
#
$ update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.6.0_13/bin/java 300

# select from the list now with:
#
$ update-alternatives --config java
There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
 + 1           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
   3           /usr/lib/jvm/jre1.6.0_13/bin/java

Enter to keep the current selection[+], or type selection number:  3