How to install / enable Java Plugin / Applets in Firefox on CentOS 5

By angsuman, Gaea News Network
Monday, September 28, 2009

CentOS comes with OpenJava JRE installed. However that doesn’t provide the required libraries to run Java from browsers (read: applets). Here are the steps to install and enable applets / Java plugin in Firefox browser on CentOS 5.

Note: The instructions may be applicable to other versions of CentOS, Fedora, others Linux distros too. However it has only been tested on CentOS 5.3.

1. First you need to install JRE 6 or JDK 6.

2. Now you need to add the Java you have installed to the list of alternatives for the java executable:
/usr/sbin/alternatives –install /usr/bin/java java /usr/java/latest/bin/java 2

Note: There is two - (hypen) before install. However wordpress may replace both of them with a separate character, so just don’t copy-paste here.

Note: Tinker with /usr/java/latest/bin/java if you do not have Java installed at this location. In other words change it to point to the location of your installed Java executable from Sun.

3. Now configure alternatives to select the latest Java executable under /usr/java:
/usr/sbin/alternatives –config java

Check the version of Java to ensure that it is from Sun:
java -version

For example, this is the output I get:

java version “1.6.0_16″
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)

Go to /usr/lib64/mozilla/plugins:
cd /usr/lib64/mozilla/plugins

4. Create a symbolic link to (Firefox plugin for Java):
ln -s /usr/java/latest/jre/lib/amd64/

Note: The above is applicable for JDK installation. For JRE it is likely to be:
ln -s /usr/java/latest/lib/amd64/

5. Restart Firefox and type the following in URL field and press Enter:

You should now see a section titled Java(TM) Plug-in 1.6.x

You are done installing Java Plugin / Applet support in Firefox on CentOS 5.

will not be displayed