Install Sun Java in Fedora

I’m using a fedora system which in a default installation has IcedTea Java installed. I like to use the official Sun Java version, so here is an instruction for installing Sun Java in Fedora. I downloaded Java Runtime Environment from here

Become root

sudo su -

First uninstall IcedTea Java.

I want to install Java in the

/usr/java

directory, so I create that first.

mkdir /usr/java
cd /usr/java/

Since I downloaded the package to my Home/Downloads directory I first move it to

/usr/java
mv /home/USERNAME/Downloads/jre-6u21-linux-i586-rpm.bin /usr/java/

Make it executable

chmod a+x /usr/java/jre-6u21-linux-i586-rpm.bin 

Execute the package

./jre-6u21-linux-i586-rpm.bin

The package extracts the contents of the package into a new folder (in this case

/usr/java/jre1.6.0_21

) so you have to cd in there

cd jre1.6.0_21

Install the rpm package

rpm -iv jre-6u21-linux-i586.rpm 

Now since I’m using Firefox and I like to install the Sun Java plugin I first have to locate where it is

whereis firefox

Since it says it’s installed in

 /usr/lib/firefox-3.6/

I’ll check if there is a plugins directory in that folder

ls /usr/lib/firefox-3.6/ |grep plugins

In my case it wasn’t there so I created it

mkdir /usr/lib/firefox-3.6/plugins

Now since I’m using Firefox 3.6 I create a symbolic link to libnpjp2.so, and not libjavaplugin_oji.so, like the Java instructions tell you

ln -s /usr/java/jre1.6.0_21/lib/i386/libnpjp2.so /usr/lib/firefox-3.6/plugins/libnpjp2.so

After restarting Firefox it should have the Sun Java plugin installes. You can check that by typing

about:plugins

in the firefox address bar