Installing Sun Java on Fedora 12 RedHat RHEL CentOS

5 Feb

Fedora Generic BannerIf 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
Sun Java

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

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:

Java SE Runtime Environment 6u18

Sun Java
or on x86_64
Java SE Runtime Environment 6u18

Sun Java

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

su -c ‘sh jre-6u18-linux-i586.rpm’

On x86_64:
su -c ‘sh jre-6u18-linux-x64-rpm.bin’

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/ \
/usr/java/default/plugin/i386/ns7/ 20000'

For x86_64:
su -c '/usr/sbin/alternatives --install \
/usr/lib64/mozilla/plugins/ \
/usr/java/default/lib/amd64/ 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/ \
/usr/java/default/plugin/i386/ns7/ 20000'

For x86_64:
su -c '/usr/sbin/alternatives --install \
/usr/lib64/mozilla/plugins/ \
/usr/java/default/lib/amd64/ 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:
Sun Install


I am ben kevan.. Well yeah. .that's about it.

2 thoughts on “Installing Sun Java on Fedora 12 RedHat RHEL CentOS

  1. Nice list, but you seem to have missed out the final “alternatives config java” step to actually select the newly installed JRE. Without this, the old one will still be selected.

    $ /usr/sbin/alternatives –config java

    Your java plugin for Firefox is also rather out of date, or confused. Presuming you’re on Firefox 3.6 or later, it should be for i386 as well as x64:

    /usr/sbin/alternatives –install /usr/lib/firefox-3.6/plugins/ /usr/java/jdk1.6.0_20/jre/lib/i386/ 20000

    (note, I’ve used the /usr/java path that the sun -rpm.bin installed to on my Fedora Core 12 system)

    You may also refer to another howto:

    Your mileage may vary :)

  2. Oh, and set the java plugin via alternatives, also:

    $ /usr/sbin/alternatives –config

    and select the one you’ve just installed. My old was still selected, after installing the 1.6.0_20 option as in my previous comment.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>