Tuesday, April 14, 2009

java plugin for 64 bit firefox

An issue that bothered many users of 64bit Linux is hopefully a history since JavaSE 6u12, which is now available in development version (therefore it is not a stable build and it is not recommended for "production use"). I have managed to install a Java plugin for Firefox on my 64bit Ubuntu - installation was pretty flawless...

Confirmed here: https://jdk6.dev.java.net/6uNea.html

So, what do you need to do in order to have a working Java in your Firefox on 64bit Linux?

  1. Update: Use Firefox from your distro repository.
  2. Rollback all your previous attempts to make Java work - if you don't perform this step, the result is uncertain... This includes especially following:
    • Make sure you have 64bit version of Firefox (previous workaround was to use 32bit version of browser). Note that there is also a 64bit Flash plugin for Linux available, so 32bit version of browser should not be needed anymore...
    • Remove IcedTea/gcj/... plugin if you were using it
  3. Download JRE 6u12 (an early access) from pages with JavaSE 6u12 dowloads (you can use this link pointing to the b03) and install Java to any desired folder (I would suggest /usr/lib/jvm folder for Ubuntu users, this is where Ubuntu places Java by default)...
  4. Create a link (ln) pointing to the Java plugin (file /lib/amd64/libnpjp2.so) in the ~/.mozilla/plugins folder (to let Firefox know where the new plugin is...) - maybe you will have to create this folder (I had to)
  5. Make sure the installation didn't interfere with the rest of your Java environment and that you are using stable Java system wide (call java -version). If not, reconfigure your Java environment, for example using update-java-alternatives command (thank's to Petr Chytil for the hint)
Note/Update: Are you getting "LoadPlugin: failed to initialize shared library /opt/java/jre1.6.0_12/lib/amd64/libnpjp2.so [/opt/java/jre1.6.0_12/lib/amd64/libnpjp2.so: wrong ELF class: ELFCLASS64]" message? Try to use the Firefox that is in your distro's repository. The problem Werner was facing (see the discussion below) was resolved by installing official openSUSE packages instead of the Firefox from mozilla site... Werner, thank you a lot for not giving up and elaborating on the issue!