Saturday, December 1, 2007

How to make Java Runtime Environment 1.6 (JRE plugin) work on Firefox 2.0.0.8

In a nutshell: Do not use an official package from Sun. Use your package manager to update your system with latest Java package.

I had run into an issue getting Java Runtime Environment to run on openSUSE 10.3, using Firefox 2.0.0.8. I have arrived at a solution and wanted to share what I had encountered and done.

I wanted to use an applet at school from Blackboard. In order to use it, I needed to download and enable JRE. When attempting to load the applet on Blackboard, Firefox let me know that a plugin was missing. I clicked on a button to install the missing plugin, but an automatic installation was not available. I was directed to Sun Website to obtain the latest JRE, which was 1.6.0_03 (release 6 update 3). I downloaded the file jre-6u3-linux.i586-rpm.bin and extracted it in the recommended location /usr/java using root priviledges. The autoextracting rpm file installed without errors. Following the directions I made a symbolic link to the plugin, which came with the JRE package. I placed the link in /usr/lib/firefox/plugins - where I also found a null plugin lubnullplugin.so. I linked the recommended Mozilla 1.4 or higher plugin by executing ln -s /usr/java/jre1.6.0_03/plugin/i386/ns7/libjavaplugin_oji.so

I launched reloaded Firefox, but the applet at school did not load. I went to Sun Website <http://www.java.com/en/download/installed.jsp> to verify the installation. The verification took over a minute and failed. So I thought maybe I could use a different location for the plugin link. I tried /usr/lib/browser-plugins and /home/voitek/.mozilla/plugins location without much luck. I looked at the Firefox plugin registration file pluginreg.dat in the Firefox directory in my home folder at the following location: /home/voitek/.mozilla/firefox/. I saw that the plugin was registered, and it looked something like this:

/usr/java/jre1.6.0_03/plugin/i386/ns7/libjavaplugin_oji.so:$
:$
1190700609000:1:1:$
Java(TM) Plug-in 1.6.0_03:$
Java(TM) Plug-in 1.6.0_03-b05:$
33
0:application/x-java-vm:Java::$
1:application/x-java-applet:Java::$
2:application/x-java-applet;version=1.1:Java::$
3:application/x-java-applet;version=1.1.1:Java::$
4:application/x-java-applet;version=1.1.2:Java::$
5:application/x-java-applet;version=1.1.3:Java::$
6:application/x-java-applet;version=1.2:Java::$
7:application/x-java-applet;version=1.2.1:Java::$
8:application/x-java-applet;version=1.2.2:Java::$
9:application/x-java-applet;version=1.3:Java::$
10:application/x-java-applet;version=1.3.1:Java::$
11:application/x-java-applet;version=1.4:Java::$
12:application/x-java-applet;version=1.4.1:Java::$
13:application/x-java-applet;version=1.4.2:Java::$
14:application/x-java-applet;version=1.5:Java::$
15:application/x-java-applet;version=1.6:Java::$
16:application/x-java-applet;jpi-version=1.6.0_03:Java::$
17:application/x-java-bean:Java::$
18:application/x-java-bean;version=1.1:Java::$
19:application/x-java-bean;version=1.1.1:Java::$
20:application/x-java-bean;version=1.1.2:Java::$
21:application/x-java-bean;version=1.1.3:Java::$
22:application/x-java-bean;version=1.2:Java::$
23:application/x-java-bean;version=1.2.1:Java::$
24:application/x-java-bean;version=1.2.2:Java::$
25:application/x-java-bean;version=1.3:Java::$
26:application/x-java-bean;version=1.3.1:Java::$
27:application/x-java-bean;version=1.4:Java::$
28:application/x-java-bean;version=1.4.1:Java::$
29:application/x-java-bean;version=1.4.2:Java::$
30:application/x-java-bean;version=1.5:Java::$
31:application/x-java-bean;version=1.6:Java::$
32:application/x-java-bean;jpi-version=1.6.0_03:Java::$

I made certain that Java was enabled in Firefox by going to Edit menu > Preferences > Content tab. I had disabled it and tried verifying the installation using the Sun website. The Webpage informed me that I should enable Java and cookies before trying to verify it. At least I knew the OFF switch on that Content tab was working properly. I re-enabled the Java option by checking the checkbox and verified the installation again using the Sun Website. Verification failed again.

I hit the Web in search for answers and came up empty many times. I just could not think of a set of keywords that would get me some information. It had seemed as if I were the only one with this issue. Then finally I got lucky and found a reference on a Mandriva discussion forum somewhere. Someone had a similar issue. In one of the replies to the original post someone suggested that he download the Java package using the Mandriva package manager. I decided to give that a try on my openSUSE 10.3 using YaST. I found JRE 1.6-sun and -plugin packages. So I dumped the /usr/java directory and installed Java from the package manager.

Installation proceeded without issues. My new Java Runtime Environment package installed to /usr/lib/jvm/java-1.6.0.u3.sr2-sun-1.6.0.u3 along with the other Java packages. I had at least two, but neither one had the plugin I needed for Firefox. When selecting the Java download from YaST I also selected the plugin package. This installed the libjavaplugin_oji.so plugin to /usr/lib/jvm/java-1.6.0.u3.sr2-sun-1.6.0.u3/jre/plugin/i386/ns7 directory. I linked the .so library file to my home directory ~/.mozilla/plugins, launched Firefox, and voilla - everything worked fine.

This is the second time openSUSE community taught me a lesson on using the package manager. I had once tried installing the .docx converter for openoffice, and even though the installation files and instructions came from a Novell Website, the converter did not work. I never got this feature to work manually. Then finally I used the openSUSE updater, and it found an openoffice update with this .docx format converter, installed it automatically, and openoffice was able to read and write .docx Microsoft Word format going forward.

No comments: