Sun Java Firefox plugin working on Ubuntu Hardy amd64

Finally, finally, FINALLY! The Sun Java plugin now works on Firefox amd64 in native 64-bit. It has already been included in Ubuntu 9.04 Jaunty, but the packages work just fine on Hardy as well, and probably on Intrepid.

Just download and install the Jaunty versions of sun-java6-bin, sun-java6-jre, sun-java6-fonts, and sun-java6-plugin. Install them, and remove the old icedtea plugin if you have it:

sudo dpkg -i sun-java6-bin_6-13-1_amd64.deb sun-java6-fonts_6-13-1_all.deb sun-java6-jre_6-13-1_all.deb sun-java6-plugin_6-13-1_amd64.deb
sudo apt-get remove --purge icedtea-gcjwebplugin

Then restart Firefox and Sun java will load natively 64-bit. Check it:

tyler@baal:~$ java -version

java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)

I’ve included them in the repository.

Update 2009-07-16: A more recent version is now available in the hardy-updates repository. I have removed the above copy from my repo. Intrepid users should upgrade to jaunty anyway, but can still download packages directly.

Tags: , , , , , ,

  1. Ferran’s avatar

    Hi !!!

    How could you make it work if plugin_6-13-1_amd64.deb is empty?

    After installing the 4 packages java is update but firefox fails in open applets because there is not any suitable java plugin in /usr/lib/firefox/plugins.

    Can you explain what else you did?

    Best,

    Ferran

    Reply

  2. tyler’s avatar

    Hi Ferran,

    The package installs the plugin to /usr/lib/jvm/java-6-sun/jre/lib/amd64/, then uses a postinst script to symlink that into various directories, including /usr/lib/firefox/plugins. If that didn’t happen, something broke the configuration process. Try:

    sudo apt-get -f install

    And make sure it actually finished installing. If you installed it via dpkg it won’t fix broken dependencies, and will stop before configuring.

    Reply

  3. Halito’s avatar

    Oh it works beautifully!

    Thanks a lot!

    Halito

    Reply

  4. vic’s avatar

    Hey thanks a ton for this… I lost my mind trying to get java to work on Firefox this afternoon until I ran across your post.

    cheers!

    Reply

  5. Teguh Imanuel’s avatar

    Just want to add a small “detail” to the awesome explanation by Tyler :
    from the terminal type the following :

    cd /usr/lib/mozilla/plugins
    sudo ln -s /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so

    in short , the file for Firefox Java plugin is libnpjp2.so.

    Tyler …… you are awesome, Thanks for sharing !!!!

    Reply

  6. tyler’s avatar

    Teguh,

    You shouldn’t have needed to do this. It was already handled by the alternatives system for me:

    tyler@baal:~$ ls -la /usr/lib/mozilla/plugins/libjavaplugin.so
    lrwxrwxrwx 1 root root 39 2009-04-08 17:12 libjavaplugin.so -> /etc/alternatives/mozilla-javaplugin.so

    tyler@baal:~$ ls -la /etc/alternatives/mozilla-javaplugin.so
    lrwxrwxrwx 1 root root 49 2009-07-16 10:13 /etc/alternatives/mozilla-javaplugin.so -> /usr/lib/jvm/java-6-sun/jre/lib/amd64/libnpjp2.so

    Reply

  7. Jeff’s avatar

    Thanks for your help!

    1) I went into Synaptic Package Manager and marked for installation the the files you listed above (sun-java6-bin, sun-java6-jre, sun-java6-fonts, and sun-java6-plugin).
    2) Close Synaptic
    3) Then I executed your command to remove icedtea (sudo apt-get remove –purge icedtea-gcjwebplugin)
    4) Restart firefox

    And Done! Thanks for the help!!!!

    Reply

Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.