Installing Sun Java on Fedora 12 RedHat RHEL CentOS
If you’re new to Fedora you’ll notice there are a few special cases with Fedora. #1, they do not ship any packages that are not within compliance with GPL and that means Sun Java.
In this tutorial I’ll show how you can install Sun Java (which can replace an openjdk installation).
Q: Why Would You Want Sun Java?
A: Well in my case there are some java based applications that do not work with OpenJDK (yet).
First you’ll want to download the latest Sun Java JRE, which at the time of this writing was 6 Update 18. You can download the latest JRE packages from http://java.sun.com/javase/downloads/index.jsp.

On this page you’ll choose your installation package:
For 32-Bit Installation choose Linux
For 64-Bit Installations choose Linux x64

After you’ve picked your package, agree to the license and click on “Continue”.
Note: Note you can sign up for their news letter if you wish.
The next page will be where you download the package. The package you’re looking at downloading is:
jre-6u18-linux-i586-rpm.bin

or on x86_64
jre-6u18-linux-x64-rpm.bin
You can either click on the .bin, or use the checkbox and utilize the sun download manager (I don’t see any reason to, as the size of the download is quite minimal at under 20MB).
Once download you will install the package with:
On x86
or
On x86_64:
You’ll have to agree to the license by pressing q, then typing yes.
Some stuff will pop up, wham, bam then the installation process is done, but some further configurations are needed.
First lets make sure that Fedora will use Sun Java instead of OpenJDK which is done with the alternatives command:
su -c '/usr/sbin/alternatives --install /usr/bin/java java \
/usr/java/default/bin/java 20000'Now you want to setup the Sun Java Plugin for your firefox browser:
For x86
su -c '/usr/sbin/alternatives --install \
/usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so \
/usr/java/default/plugin/i386/ns7/libjavaplugin_oji.so 20000'For x86_64:
su -c '/usr/sbin/alternatives --install \
/usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 \
/usr/java/default/lib/amd64/libnpjp2.so 20000'You can do the same for your Opera browser if you wish:
For x86
su -c '/usr/sbin/alternatives --install \
/usr/lib/opera/plugins/libjavaplugin.so libjavaplugin.so \
/usr/java/default/plugin/i386/ns7/libjavaplugin_oji.so 20000'For x86_64:
su -c '/usr/sbin/alternatives --install \
/usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 \
/usr/java/default/lib/amd64/libnpjp2.so 20000'Note: The \’s indicated in the above commands are to break the line. If you are typing it yourself, you can type it without the \ as a single line installation, or just copy and paste the above into your terminal.
After you setup the browser plug-ins you’ll have to close your browser.
To verify your plug-in are being used by your browser type: about:plugins in the address bar to get a screen like so:







