Gentoo Wiki



Firefox and Java

As I edit this on 1 May 2008 a working full-featured 64 bit java browser plugin has only become available relatively recently. This is Icedtea and unless things have changed very recently it is still not available in portage. This and other options are set out below.

Firefox and Sun's OpenJDK/IcedTea JDK

Warning: Please note that this solution requires the use of portage overlays. It may also require an upgrade to gcc which can easily break your system. Please only attempt this if you are comfortable with your system and prepared to suffer the consequences if it breaks.

The Java overlay now contains ebuilds for both IcedTea6 (Java 1.6) and IcedTea (the forthcoming Java 1.7, which is not yet standardised). Unless you intend to do JDK development work, we suggest installing icedtea6.

IcedTea6 requires an existing JDK in order to build, so you first need to install gcj-jdk, also from the overlay. (Alternatively, you could temporarily install the binary, non-plugin-including version just to compile from; see next paragraph.) This depends on gcc 4.3.1 being built with the gcj USE flag. You don't have to have this selected as your default compiler, but it has to be installed as only this version of gcj supports the 1.5 language features of Java. Once gcj-jdk is installed, you can emerge icedtea6. For further information, please see the IcedTea wiki.

If you don't want the hassle of installing gcc 4.3.1, you can first emerge sun-jdk, then emerge icedtea6, then emerge -C sun-jdk. This will let you use the 64-bit binary version provided by Sun to compile your IcedTea. Note that this isn't as "pure" a method as above; while you end up with only locally-compiled software on your finished system, you used precompiled binaries to bootstrap.

Then make the new icedtea java the default 64 bit browser plugin: eselect java-nsplugin set 64bit icedtea6-1.2. That's it. You should now have a working amd64 java browser plugin.

Warning: Please note that all the solutions below require installing proprietary/non-Free software.

Firefox and Sun's Legacy Proprietary JDK

Unfortunately while Sun have now given us an amd64 edition of Java, it doesn't include Java Web Start or the Netscape-compatible plugin (which Firefox uses). And because the portage packages all install the 64-bit edition now, the 32-bit edition has to be installed manually.

emul-linux-x86-java-1.6 can be installed from portage for 32 bit support so please use this instead of manual method!

Updated Method Using emul-linux-x86-java-1.6

Make sure you have emerged the following packages:

NOTE: the mozilla-firefox-bin package will install the 32-bit version even if you are running a 64-bit system

NOTE: the emul-linux-x86-java package must have the nsplugin use flag enabled!

Code: Create symlink to Java nsplugin
mkdir -p /usr/lib64/nsbrowser/plugins 
cd /usr/lib64/nsbrowser/plugins/
ln -s /opt/emul-linux-x86-java- . 

Temporary workaround for Firefox 3 RC3 and emul-linux-x86-java-

Code: This tip from gerardo
cd /opt/firefox/plugins
ln -s /opt/emul-linux-x86-java- . 

Manual Method

Warning: The following method doesn't use packages from portage. This means that you will not be able to use emerge to manage its installation, upgrade or uninstallation. Gentoo does not support this method, and will not be able to assist users who decide to use it.

Go to and download the self-extracting file (not the rpm). Make sure you download the 32-bit (i586) version of JRE.

Once downloaded, install Java by running: sh jre-1_5_0-linux-i586.bin

Follow the installation instructions to complete the installation of Java. Next, move the newly installed Java to under /opt (where all binary packages should go) with: mv jre1.5.0_06 /opt/sun-jre-bin-

Now create a symlink in a directory that will be searched by browsers looking for Netscape-compatible plugins:

Code: Create symlink to Java nsplugin
mkdir -p /usr/lib32/nsbrowser/plugins
cd /usr/lib32/nsbrowser/plugins/
ln -s /opt/sun-jre-bin- .

Firefox and Blackdown JDK

Warning: Blackdown Java plugin has not functioned properly on AMD64 for some time. The use flag to build the plugin has been disabled, apparently due to security issues, and simply specifying it in make.conf or on the command line does not work. It is still possible to enable the use flag and build the plugin, but in my experience it crashed continually and was unusable. Given the security issues, I do not propose to set out how to enable the building of the plugin here. This information is readily available by a simple search. If you must, once installed, the old instructions to make it work with firefox are set out below.

Check that you have dev-java/blackdown-jdk installed and that it was built with the nsplugin use flag. Then create a symlink so Firefox will find the plugin:

ln -s /opt/blackdown-jdk-YOURVERSIONHERE/jre/plugin/amd64/mozilla/ /usr/lib/mozilla-firefox/plugins/

Retrieved from ""

Last modified: Tue, 30 Sep 2008 03:35:00 +0000 Hits: 7,773