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
