My last blog entry covered issues running a 64bit Linux desktop. I promised more details on installing and using 64bit Java applet support with 64bit Firefox.
Note this blog entry has been updated on Sept 21st, 2009 to reflect JDK 6 Update 16.
Java Installation Primer
Currently, there are many methods to install Java on Linux:
- Use the Sun Java RPMs or installer only.
- Use the Sun Java RPMs along with the java-1.6.0-sun-compat RPM to get JPackage policy compliance enabling the /etc/alternatives for managing multiple concurrent Java JVM installation.
- Use the Sun Java RPMs provided by your distribution. For example, with Red Hat Enterprise Linux 5, enabling the RHEL Supplementary software channel enables you to install and automatically keep current the Sun Java RPMs which have been repackaged into a JPackage compliant form.
Using Method 1 - Sun RPMs only
When using method 1 above, you'll download the file jdk-6u16-linux-x64-rpm.bin or jdk-6u16-linux-i586-rpm.bin. After making it executable, you'll run the file which will extract and then install the following RPMs:
jdk-6u16-linux-amd64.rpm or jdk-6u16-linux-i586.rpm
sun-javadb-client-10.4.2-1.1.i386.rpm
sun-javadb-common-10.4.2-1.1.i386.rpm
sun-javadb-core-10.4.2-1.1.i386.rpm
sun-javadb-demo-10.4.2-1.1.i386.rpm
sun-javadb-docs-10.4.2-1.1.i386.rpm
sun-javadb-javadoc-10.4.2-1.1.i386.rpm
Finally, to install Java Applet support for Firefox and other browsers that are compatible with Firefox plugins, create a symlink in the Mozilla plugin directory:
- 64bit Java Applet Support (new with Java 1.6.0_12)
cd /usr/lib64/mozilla/plugins
ln -s /usr/lib/jvm/java-1.6.0-sun-1.6.0.16/jre/lib/amd64/libnpjp2.so
- 32bit Java Applet Support
cd /usr/lib/mozilla/plugins
ln -s /usr/lib/jvm/java-1.6.0-sun-1.6.0.16/jre/plugin/i386/ns7/libjavaplugin_oji.so
Notice that the browser plugin library filename is different between 32bit and 64bit java.
Using Method 2 - Sun RPMs with JPackage compatibility
To use method 2, install the same RPMs in method 1 above, but then install one more additional RPM that makes the Sun RPMs compatible with the JPackage policy.
That RPM is the java-1.6.0-sun-compat RPM, and you would normally simply obtain it from the JPackage website. The only problem is that as of September 2009, the package is out of date (currently only supporting Sun Java 1.6.0_03).
I have created a java-1.6.0-sun-compat RPM that works with 1.6.0_16. Note that ever since Sun Java version 1.6.0_12 64bit Java Applet support has been available. You can grab it here:
64bit - java-1.6.0-sun-compat-1.6.0.16-1jpp.x86_64.rpm
32bit - java-1.6.0-sun-compat-1.6.0.16-1jpp.i586.rpm
Using the java-1.6.0-sun-compat RPM there is no need to manually create the browser plugin symlink.
For the sake of completeness and if you are into creating RPMs yourself, you might be interested in the SPEC and the SRPM file and the patch to the SPEC. Normally you don't need these files.
java-1.6.0-sun-compat.spec
java-1.6.0-sun-compat-1.6.0_06-to-1.6.0_12.spec.patch
java-1.6.0-sun-compat-1.6.0.16-1jpp.src.rpm
Using Method 3 - Using Sun Java included with your distribution
If you are using Red Hat Enterprise Linux v5 with a RHN subscription, getting the latest Sun Java automatically installed on your systems is pretty easy.
- Login to RHN
- Subscribe to the RHEL Supplementary software channel on the desired system
- Back on your 64bit system run:
yum install java-1.6.0-sun java-1.6.0-sun-plugin.x86_64
On a 32bit system run:yum install java-1.6.0-sun java-1.6.0-sun-plugin
- Optionally, if you want the JDK and not just the JRE (because you plan on compiling Java software), then run:
yum install java-1.6.0-sun-devel

Thanks for providing java-1.6.0-sun-compat-1.6.0.12-1jpp.i586.rpm. I tried installing it on my Fedora 10 box and got this output:
link /usr/bin/javaws incorrect for slave javaws (/usr/share/javaws javaws)
It looks like the postinstall scriptlet for your RPM is telling 'alternatives' that javaws is in /usr/share but alternatives is already tracking it in /usr/bin where the java-1.6.0-openjdk-1.6.0.0-9.b14.fc10.i386 RPM that Fedora installed for me puts it.
I found another RPM like yours at http://sophie.zarb.org/srpm/Scientific,51,/java-1.6.0-sun-compat and the change log for that one mentions putting javaws in /usr/bin but that also doesn't work - the post-install script contains:
>>>
--slave /usr/bin/javaws javaws_bin /usr/lib/jvm/jre-1.6.0-sun/bin/javaws \
[...]
--slave /usr/share/javaws javaws /usr/lib/jvm/jre-1.6.0-sun/javaws
<<<
That still doesn't match my setup, I guess.
I guess I will grab your SPEC file patch and then apply the patch from https://www.jpackage.org/bugzilla/show_bug.cgi?id=192 to move javaws and see if that works!
i have modified the .spec for jdk 1.6.0.13 (tested on fedora 10 amd64):
- changed the version number to 13 (easy ;))
- changed the line:
--slave %{_datadir}/javaws javaws %{jrebindir}/javaws
to:
--slave %{_bindir}/javaws javaws %{jrebindir}/javaws
as update-alternatives was unable to set the slave for javaws, so no java alternative..
the updated spec is here:
http://download.tuxfamily.org/emiscabpo/other/java-1.6.0-sun-compat.spec
I was installing Fedora 11 32-bit and Fedora 11 64-bit on two separate machines. I was aware of the plug-in's absolute path and filename for the 32-bit version but couldn't figure out what's it like with 64-bit version. Your article has helped me. Thank you.
You are the man! It works beautifully! Thanks!
Thanks for providing these instructions and RPMs. Since 1.6.0.16 is out I had to do quick update to your source RPM to build compat RPMs for this version. Here is SRPM and x86_64 RPM:
http://www.crocodile.org/rpms/java-1.6.0-sun-compat-1.6.0.16-1jpp.src.rpm
http://www.crocodile.org/rpms/java-1.6.0-sun-compat-1.6.0.16-1jpp.x86_64.rpm
Thanks for the comments. I have updated the RPMs on this page to 1.6.0.16. That includes both the i586 and x86_64 RPMs.
Also I changed the javaws binary to be in /usr/bin/ (this follows what Fedora is doing now).