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
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)
ln -s /usr/lib/jvm/java-1.6.0-sun-184.108.40.206/jre/lib/amd64/libnpjp2.so
- 32bit Java Applet Support
ln -s /usr/lib/jvm/java-1.6.0-sun-220.127.116.11/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:
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.
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_64On 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