European Open Root Server Network

Firefox and the different Java Engines on a Gentoo Box

As you probably know, there is something like a "platform independent program thingie" that most people simply call "Java" (as originally named by its inventor, sun microsystems). And they are right. "Java" is actually a much better name than "platform independent program thingie" because it rather seems to be a "won't run any two different programs on the same computer thingie" to me. But this goes too far and would be worth an other article of its own. Let's call it "Java" for now.

As of today there are a small hand full of Java implementations by different parties in different versions implementing different version of the same standard. But I'm drifting away again. The major Java implementations available today are:

While working with Java, many of the Java deveolppers seem to have realised that their Java code it isn't as portable as intended. So they implemented a vendor and version check in their platform independent programs and refuse to run if they dont find an exactly identical setup of the Java environement like the one on their developement workstations. At least they want you to run the same version of the same vendor they do and otherwise terminate the program. (One of these restrictive companies is DELL with the DRAC/4 Applet for their server's remote console.)

What to do when you encounter such a piece of Software? There are two possible situations:

1. If you haven't yet spent a lot of money on this crapy piece of software
Throw it away and look for another one.
2. If you have spent a lot of money on this crapy piece of software
Throw it away, too. If that's not possible for some reason you have to switch to another implementation while spelling curses on the the programmers, Java itself and the rest of the world which might be involved (or not).

Changing the Java Plugin for Firefox

But let's now come to the action part. I had to change my Java Plugin in firefox from Blackdown 1.4 to sun-jre 1.5 to get one of these before-mentioned pieces of crapy software to get to work. But the usual symlink approach didn't work:

ln -s /opt/sun-jre-bin- /usr/lib/mozilla-firefox/plugins/

firefox was still telling me it ran blackdown java (even whe I uninstalled this heck of a blackdown-java package). After fighting with it for some time I did a google and found what I made wrong: The last time I changed my jre I must have done it the "gentoo-way" and told my system (respectively firefox) to use blackdown java. This led to the fact that firefox strictly ignored all my symlink efforts and always used blackdown as its java implementation.

So what to do? eselect offers a module called java-nsplugin which is exactly for configuring what Java plugin the Netscape-like browsers will use. To make firefox use the Sun Java Plugin simply type:

eselect java-nsplugin set sun-jre-bin-1.5

Of course you have to make sure your particular version of the jre desired is installed before doing that. If you want to know how this is set up at your gentoo box you can do this by typing:

aare cal # eselect java-nsplugin show
Current Java browser plugin

More about it: HOWTO Java and Firefox (