How to install Oracle Java Runtime Environment in Fedora 14

Fedora 14 comes with the open source Java called OpenJDK which is working fine, but if you have issues on it or its not working for whatever reason and you want to install the original Java from Oracle, just follow the tutorial below.

This is a straightforward tutorial on how to install Oracle Java Runtime Environment in Fedora 14.

1. Install these libraries that needed by Java.
Open up your terminal and run this command.

yum -y install compat-libstdc++-296 compat-libstdc++-33

2. Then go to the site below and grab the latest version of Java Runtime Environment.
http://java.com/en/
IMPORTANT: Make sure to download only the "Linux RPM (self-extracting file)".

3. After downloading the file, make it executable and install.

chmod +x jre-6u24-linux-i586-rpm.bin
./jre-6u24-linux-i586-rpm.bin
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
inflating: jre-6u24-linux-i586.rpm
Preparing... ########################################### [100%]
1:jre ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...
plugin.jar...
javaws.jar...
deploy.jar...

Done.

4. After the installation, you need to set the Oracle JRE as your default JRE.

alternatives --install /usr/bin/java java /usr/java/default/bin/java 1
alternatives --config java
There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
   2           /usr/java/default/bin/java

Enter to keep the current selection[+], or type selection number: 2

Select "2" and verify the version of your default java.

java -version

The output of the command should be like this:

java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)

5. Lets configure the Java plugin for you browser.

alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/default/lib/i386/libnpjp2.so 1
alternatives --config libjavaplugin.so

Your java plugin for your browser has been successfully configured.

There is 1 program that provides 'libjavaplugin.so'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/java/default/lib/i386/libnpjp2.so

Enter to keep the current selection[+], or type selection number: 

Verify the Java plugin configured for your browser using the website below.
http://www.java.com/en/download/help/testvm.xml