This short article explains what you need to to if you want to use Java applets in Firefox under Linux.
I recently installed FireFox 4 into my home directory under Kubuntu 10.04 because only version 3.6 is available in the package system and I wanted the new features now, especially sync. I need Java applet support in my browser to view protein structure data, e.g. in Jmol on the PDB website.
When you search google for this, various HOWTOs show up that suggest to install the IcedTea plugin from the openjdk package, but all this did for me was crash the browser whenever I tried to use Jmol (I didn’t try other applets). The solution seems to be to remove the IcedTea plugin, install the Sun JRE and use the module libnpjp2.so that comes with it.
Here are the commands for Debian-based distros (you’ll have to adapt them if you use SuSE, Fedora or other distros which don’t have apt). Remove the plugin and install Sun JRE:
sudo apt-get remove icedtea6-plugin
sudo apt-get install sun-java6-jre
Even if you installed Firefox manually into your home (I put it into ~/software/firefox4), it will look for plugins in your ~/.mozilla/plugins folder, so all you have to do is put a symlink in there like this:
ln -s /usr/lib/jvm/java-6-sun-220.127.116.11/jre/lib/i386/libnpjp2.so libjavaplugin_jni.so
Note that the path may be different for other distros and also if you are running a 64bit version of linux. Just search for libnpjp2.so if you aren’t sure where it is (The command find /usr -name libnpjp2.so should do it).
Here is a screenshot showing the 3D structure of triosephosphate isomerase (PDB entry 7tim) rendered in the Jmol applet: