Monday, September 11, 2006

Enable Java on Firefox on Linux

On Linux, Firefox requires JRE 1.4.2 or later.

Firefox is compiled with gcc 3.2.3, so a compatible version of the Java plugin must be used. JRE 1.4.2 contains a compatible plugin.

If you installed the JRE 1.4.2_01 RPM, this plugin is /usr/java/j2re1.4.2_01/plugin/i386/ns610-gcc32/libjavaplugin_oji.so and to install it for Firefox, do the following:

1. Open a terminal
2. Change to your Firefox plugins directory
3. Issue the following command: ln -s /usr/java/j2re1.4.2_01/plugin/i386/ns610-gcc32/libjavaplugin_oji.so

If you are using an older Linux distribution, you may need to install the gcc3 support libraries, as the gcc 3.2 version of the Java plugin requires libgcc_s.so.1 to operate. You may be able to find packages using Google.

If you are using an old or unofficial build of Firefox, you can check which compiler was used by entering about:buildconfig in the location bar and pressing enter. You will see a line such as gcc version 3.3 20030226 (prerelease) (SuSE Linux), which will show the compiler that was used. If gcc2.9x was used, you need to use the ns610 plugin, not the ns610-gcc32 plugin.

###### How I did it. ######

I download jre1.5 rpm package from Sun web site. Install it using rpm -ivh. JRE is installed under /usr/java/jre1.5...

I find firefox installed under /usr/lib/firefox-... I change directory to firefox's plugins directory. Make the symbolic link

ln -s /usr/java/jre1.5.0_06/plugin/i386/ns7/libjavaplugin_oji.so

Restart Firefox. applet works then in browser.

Note: if the applet brings down the browser, the wrong so has been linked. remove the symbolic link and firefox will go back to normal.

No comments: