First of all: this is not what you want to do: the people at the Fedora project are working hard to get a Java version running which is capable to do all the stuff which SUNs Java is able to do. More information can be found here.
However, I have some apps which are not working with this version of java – so I had to install Java in FC6, and here is the way I did it:
Get the package from SUN: java.sun.com/javase/downloads, make sure you get the self extracting RPM. Make it executable, and extract it. After that, install the plugin for Firefox:
ln -s /usr/java/jre1.5.0_09/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so
Also, make sure that there is no
libgcjwebplugin.so left in one of the plugin directories.
The main problem now is that the java executable still links to the Fedora version. To change that, execute as root:
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jre1.5.0_09/bin/java 2
Beware: as a reader pointed out, the line above is shown wrong (WordPress bug?). There must be two dashes in front of “install”!
After that, execute
/usr/sbin/alternatives --config java and input a “2” as your choice. Check if everything worked:
# java -version
java version "1.5.0_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)
Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode, sharing)
Welcome to SUNs world. One last mark: I really hope that SUN releases java as Free Software soon.