I am running Ubuntu Xenial(16.04.3 LTS).

To use Java from browser, installed firefox ESR using these commands

$ sudo add-apt-repository ppa:jonathonf/firefox-esr
$ sudo apt-get update
$ sudo apt-get install firefox-esr

Other than the ESR version of firefox, I don't have any other version of firefox installed.

Added 'plugin.load_flash_only = false' to about:config section of firefox.

In $HOME/.mozilla/plugins, created this symlink for java plugin

$ cd $HOME/.mozilla/plugins
$ ln -s /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libnpjp2.so .

Made sure Oracle's java is the default java. /usr/lib/jvm/default-java is a symlink pointing to /usr/lib/jvm/java-8-oracle.

With these changes, when I startup firefox and go the


and click on the link

 Firefox 52 ESR users: If you'd like to run the verify app as a plugin, please click here.

I get this exception in the terminal from which firefox was started

Exception in thread "main" java.lang.NullPointerException at sun.plugin2.main.server.JVMManager.getOrCreateBestJVMInstance(Unknown Source) at sun.plugin2.main.server.JVMManager.startAppletImpl(Unknown Source) at sun.plugin2.main.server.JVMManager.startApplet(Unknown Source) at sun.plugin2.main.server.JVMManager.startApplet(Unknown Source) at sun.plugin2.main.server.MozillaPlugin.maybeStartApplet(Unknown Source) at sun.plugin2.main.server.MozillaPlugin.setWindow(Unknown Source)

The java command is a symlink to /etc/alternatives/java which is a symlink to /usr/lib/jvm/java-8-oracle/jre/bin/java

I am able to run java successfully through command line

 $ java -version 
   java version "1.8.0_144" Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
   Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

Not clear why firefox has trouble using installed java.

1 Answer 1


You can workaround this.

Open your browser and type this:


Right-click on Name title, choose New Preference > Boolean

Create a new entry with this label:


set it false and restart your browser.

In fact, this solution doesn't depends on which kind of java is installed and operating in this system. In this case, Openjdk plugin didn't work with Firefox ESR, but Oracle Java, installed as followed from Digital Ocean tutorial. Although they told that it's deprecated (because it applies to Ubuntu 12.04), the procedures are the same: you can use it in ubuntu 17.10, just downloading jdk 8u161. I consider this as the best practice for Firefox, because OpenJDK will not install libnpjp2.so, essential to activate Java in Firefox ESR.

To activate this plugin at Firefox ESR, you must create a symlink to the folder where is installed your Oracle Java:

mkdir </Firefox ESR installed path>/firefox/browser/plugins
cd </Firefox ESR installed path>/firefox/browser/plugins
ln -s </Oracle Java installed path>/jre/lib/amd64/libnpjp2.so

There may be other ways to activate Java plugin in Firefox ESR, but this way really works. I downloaded Firefox 52 ESR right now and activated Java at there!

  • I already have the 'plugin.load_flash_only' setting set to 'false' in my about:config Sep 4, 2017 at 15:48
  • It's better to do ln to libnpjp2 in /usr/lib/firefox folder. Instead of cd $HOME/.mozilla/plugins, try cd /usr/lib/firefox/browser/plugins | sudo ln -s /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libnpjp2.so. Everytime I try to ln to profile folder, it doesn't work.
    – Redbob
    Sep 4, 2017 at 16:09
  • Created a symlink to /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libnpjp2.so from /usr/lib/firefox and /usr/lib/firefox/plugins directories. Still, same result, get the same exception after restart of firefox. Sep 4, 2017 at 16:15
  • And to /usr/lib/firefox/browser/plugins, you created?
    – Redbob
    Sep 4, 2017 at 17:35
  • 1
    Thanks @karel for the advice. I'll test about that. If Firefox 52 ESR works with newly recommended practice by DigitalOcean, I'll update it.
    – Redbob
    Mar 30, 2018 at 13:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .