A lot of people seem to be have trouble getting the Java plugin to work with Mozilla. I have no idea why. It's always really worked for me. :) As such I figured I'd write a document on how I went about installing Sun's Java RE 1.4.2 on my system. This is not a definative guide by the way, but it works for me™ and so I hope it works for you.
My system is a Debian 3.0 (woody) Linux box running on i386 architecture. If you're not running Debian then don't let that put you off. These instructions are general enough so that they should work on most distributions, and even though they don't use a package manager to do the install they shouldn't mess up your system. They didn't mess up mine. (No guarantees though... :)
Anyway, I downloaded Sun's Java RE 1.4.2 self extracting binary ([jp]) and went shopping. On returning I found that the 14MB self-extracting binary had finally downloaded and so I was ready to play. Joy. Please note that I did NOT grab the RPM.
(As a side note, the installation instructions for Java RE 1.4.0_01, 1.4.0_02 and 1.4.1 are very similar to these. If you are installing either of those then just substitute 1.4.0_01 and 1_4_0_01, 1.4.0_02 and 1_4_0_02 or 1.4.1 and 1_4_1 for 1.4.2 in the instructions as appropriate and you should be fine. No guarantees though. ;)
Next I read the instructions available on the web page. They are rather sparse but are somewhat useful. Once done, I performed the following operations:
ln -s j2re1.4.2 java.current
chmod -Rc g+rX,o+rX .
You may wish to edit /etc/profile (or your equivalent) so as to include /usr/local/java.sun/java.current/bin in your $PATH.
In addition to this you will also need the libstdc++-libc6.1-1.so.2 library. To see if you need it just run the ldd command on the plugin like so:
If you have the library, one of the lines in the output will look like this:
libstdc++-libc6.1-1.so.2 => /usr/lib/libstdc++-libc6.1-1.so.2 (0x40164000)
If it says it's not found then you'll need to install it. Under Debian this simple. All you need to do is to run the following command line:
apt-get install libstdc++2.9-glibc2.1
It'll download and install it for you. If it's already installed then there's an issue and you might wish to try and reinstall the package via:
apt-get --reinstall install libstdc++2.9-glibc2.1
Then test it with the above ldd command. If it still says it's not found then you have issues outside the context of this document. Sorry.
Now, if all has gone well, you have Java RE installed and functional and are ready to utilise the plugin.
Doing a local plugin install is useful if you are the only user of your sytem and you tend to upgrade Mozilla a fair bit. It keeps your plugins out of the way of the Mozilla install directory which tends to get nuked on 'sea' installs.
ln -s /usr/local/java.sun/java.current/plugin/i386/ns610/libjavaplugin_oji.so ~/.mozilla/plugins/
This is a useful option when your system has many users using it but it has the downside that you MUST be careful when installing a new version of Mozilla as you may windup fragging your plugins install.
ln -s /usr/local/java.sun/java.current/plugin/i386/ns610/libjavaplugin_oji.so /usr/local/mozilla/plugins/
If you installed Mozilla via a .deb then the location of the plugins directory changes. Please use the line below instead.
ln -s /usr/local/java.sun/java.current/plugin/i386/ns610/libjavaplugin_oji.so /usr/lib/mozilla/plugins/
Special notes are available for the following: Galeon GCC 3.0+ users and users of the 20030615+ version of the Mozilla nightly
You should now start Mozilla and go to the about:plugins page to check that all is well. If it is you'll see something like this:
Java(TM) Plug-in 1.4.2-b28
If you do not see something like that then you have some other issue that you should look into. (Why yes, this IS the copout paragraph. :)
Although, to slightly copout of the copout paragraph, there WAS an issue with Mozilla on Linux and Java (from around mid-January 2003 till 20030205) in that it did not let Java init itself properly. Bug 189461 deals with the issue and provides the following workaround if you insist on running a version of Mozilla from that time period. In order to start it you'll need to do:
LD_PRELOAD=/usr/local/mozilla/libxpcom.so /usr/local/mozilla/mozilla &
Or some variation thereof. Java should then start fine for you. The better solution is to use a Mozilla build past 20030205. If it still does not then you probably have deeper issues. ;)
Anyway, I hope this helps you out. If you would like to add anything to this document (like extra information for other Linux distributions or instructions for other operatings) then please contact me. Thanks. :)
Oh. Feedback rocks. Send me lots of feedback. :)
This document verifies as valid XHTML 1.0 strict with CSS2.
If, however, my standards have slipped, please contact me and tell me. :)
Copyright ©2002 mozilla.weebeastie.net All Rights Reserved
Last modified: Saturday, 19-Jul-2003 15:15:48 EST