Using Oracle's Java Plugin for Firefox in Ubuntu (not OpenJDK IcedTea)

This is the simplest approach I have found for using the Oracle Java Plugin for Firefox in Ubuntu, rather than the OpenJDK IcedTea plugin, which has given me nothing but problems (inconsistently running applets, refusing to update applets, no sound, full browser lock-up, etc).

Background: Ubuntu ships with OpenJDK/IcedTea, and no longer includes any Sun/Oracle JDK/JRE. There are many articles on entirely replacing OpenJDK with Oracle’s software, but none are very pretty (manual hacks to trick Ubuntu into accepting Oracle Java, using external repositories, etc.). The following approach does not remove the OpenJDK from your system. It simply circumvents the IcedTea plugin in Firefox, and only for the current user (not the entire system). This allows Ubuntu to remain happy, and your Firefox instance to use a manually installed Java Plugin (which will not be updated via Ubuntu software updates).

Notice: This works for me with Java 6 (I have not yet tried Java 7 OpenJDK/IcedTea applet behavior), but use at your own risk.

  • Install Java (I will refer to the root installation path as )
  • Disable the IcedTea plugin in Firefox & exit Firefox
  • Make this directory: [b]~/.mozilla/plugins/[/b]
  • Create symbolic link (i386 path depends on your platform): [b]ln -s <java>/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/[/b]
  • Restart Firefox, check that the Java Plug-In is installed & enjoy functional applets

I hope this is useful to others - now I can finally play the Showcase and Java4k applet games!

Hi

I use OpenJDK for years and I don’t have these problems except for sounds with games using the high level part of the JavaSound API (whereas JOAL works just fine), I’m under Mageia Linux 1. I don’t advise people to switch to Oracle’s Java Plugin. Maybe there is a problem with Ubuntu but you should not conclude the problem comes from OpenJDK itself. Best regards.

I quite agree with you - I’d like everyone to use OpenJDK, and I’m really looking forward to the open source community overcoming some of the longer-standing pains of the Sun/Oracle JDK/JRE/Plugin.

However, I have absolutely no success with IcedTea in Firefox in Ubuntu. It may very well be Ubuntu’s fault (old version, poor dependencies, etc.). Regardless of who holds the blame, it doesn’t work (for me) in practice. I’ve tried off and on for months to find a suitable way to address the issue, and this is the simplest, least obtrusive (to the OS at large) approach.

If there’s a way to make IcedTea work in Firefox in Ubuntu, that would be a welcome addendum to this article.

OpenJDK != IceaTea

I use IcedTea6 1.10.4 (which is based on Sun’s build drops of OpenJDK6) with OpenJDK Client VM (build 20.0-b11, mixed mode). I may plan to switch one of my machines to Ubuntu or Debian, then I will try to reproduce your “bugs”.

Do you have the same problem with OpenJDK 1.7?

For those who want to know the proper approach, it’s to use the alternatives system. There are tutorials around. It is, however, not simple. If there’s a lot of interest in a shell script, I could try to put something together.