[Howto] Sun-Java on FC6

fedora-logo-bubbleFirst 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.


6 thoughts on “[Howto] Sun-Java on FC6”

  1. No, haven’t tried that, but read about as well – actually there are several comments available pointing out that the way described here is not the best way, and that you should take the jpackage-way. However, I needed a real *quick* one and wanted to remember that 🙂

  2. >/usr/sbin/alternatives –install /usr/bin/java java /usr/java/jre1.5.0_09/bin/java 2

    Corrected version:
    /usr/sbin/alternatives –-install /usr/bin/java java /usr/java/jre1.5.0_09/bin/java 2
    (all in one line)

  3. Thanks a lot for this! I’ve struggled with getting the gcj version to work with Azureus off and on for the past year and a half. Following these instructions, I got it up and running in no time at all!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s