Finally, Sun release 64 Bit Browser Plugin Support for JRE (almost)Posted by Hodge on Jan 18, 2009 in Linux, Ubuntu • 6 comments •
Update 05/02/09: Sun have actually released the update – no more beta – so I’ve modified “Install Java JRE 1.6.0 (Update x) in Linux as the Default Java Runtime, including Firefox Browser Plugin” to reflect this (even the title has changed – although the URL remains the same!). The following tutorial remains for reference etc.
Back in January 2003, a bug was submitted to Sun pointing out that there is no 64 Bit Browser plugin support for JRE. Almost 6 years later, the issue seems to have been addressed: with the latest Beta release of JRE6 Update 12, Sun have finally developed and included the required Plugin to run 64 Bit Java, in a 64 Bit Web Browser on a 64 Bit OS. So, I decided to give it a try, and see what’s what. Since this is a Beta release (currently b3), and also deals specifically with 64 Bit, I’m keeping this post separate from my main HowTo on installing JRE: Install Java JRE 1.6.0 (Update x) on Hardy as the Default Java Runtime, which will be updated to include the new information when JRE6 u12 Final is released – hopefully sometime early this year (2009).
The first step is to download the installation file, jre-6u12-ea-bin-b03-linux-amd64-22_dec_2008.bin, which as usual was saved to my cluttered desktop. I have previous versions of JRE installed in /opt/java, but the directoty can be created as follows, if it doesn’t already exist:
sudo mkdir /opt/java
Once the installation file had downloaded, I moved it to the /opt/java directory, made it executable, and ran the setup:
sudo mv ~/Desktop/jre-6u12-ea-bin-b03-linux-amd64-22_dec_2008.bin /opt/java
sudo chmod 755 jre-6u12-ea-bin-b03-linux-amd64-22_dec_2008.bin
After reading and agreeing to the Licensing terms, the executable extracts all the relevant files into a subdirectory: jre1.6.0_12
Setting JRE6 u12 as the Default Java Runtime
To install JRE6 u12 as the default Java for the system, simply run the following two commands:
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jre1.6.0_12/bin/java" 1
sudo update-alternatives --set java /opt/java/jre1.6.0_12/bin/java
Following the execution of both commands, there should be output along the lines of:
Using '/opt/java/jre1.6.0_12/bin/java' to provide 'java'.
Installing the Browser Plugin
The part I’m really interested in for the moment, is getting the 64 Bit JRE Browser Plugin installed, which thankfully is very easy. As with most Firefox plugins, they can be installed in ~/.mozilla/plugins – if it doesn’t exist, it can be created:
It may also be necessary to uninstall any previous Java installations, such as IcedTea etc.:
sudo apt-get remove icedtea-gcjwebplugin
The Plugin can be installed by either copying the file:
cp /opt/java/jre1.6.0_12/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
or by creating a symbolic link to the file (the best option, since it allows updating to the final release without recopying the file etc.)
ln -s /opt/java/jre1.6.0_12/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
Once installed, restart Firefox. There are two methods to see if the Plugin is installed – navigate to about:plugins
or to the Java Tester Page
Looks good so far – I can finally upload photos to Facebook using the Java Applet!