Adding Java to alternatives

This will apply to any distro that uses alternatives and update-alternatives for managing java as well as various other apps.  I'd downloaded jre-1.6_04 from java.sun.com, and therefore, wanted to ensure my system was allowed to use this as part of alternatives, without having to do everything manually.  It's nice and easy, all you have to do is:

alternatives --install /usr/bin/java java /usr/java/jre1.6.0_04/bin/java 3

this then adds java to position three within alternatives.  The reason I did this, was because position 1 and 2 was already taken by jre-1.5.0-gcj and jre-1.7.0-icedtea that comes pre-installed on Fedora 8.  After you've added it to the alternatives, you then need to activate it if you wish to use this version, so:

update-alternatives --config java

and then choose position 3 to use the version you've just installed.  When you then run:

java -version

from the command prompt, it will or should show the version you've just installed and added to alternatives.