8

Recently I installed Oracle Java. It worked fine, But with the recent upgrade with Firefox throws an error.

I checked it here, which says:

Starting with Firefox Version 52 (released in March 2017), Firefox has limited support for plug-ins, and therefore will not run Java. Use the Java Control Panel to find the installed Java version.

I double checked the symbolic link also. It is configured properly

$ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)

How can I run java applets in firefox?

2

Further commentary from Oracle is linked by the page you quoted, Firefox has taken the explicit decision to stop providing the NPAPI to plugins aside from Flash, essentially meaning, Firefox will not listen to anything Java might try to say.

Firefox 52 and above

Beginning with Firefox 52 (released March 2017), plug-in support is limited to Adobe Flash, and drops support for NPAPI, impacting plugins for Java, Silverlight, and other similar NPAPI based plugins.

If you have problems accessing Java applications using Firefox, Oracle recommends using Internet Explorer (Windows) or Safari (Mac OS X) instead.

Your solution then would normally have to be to run Java applets in a browser that allows Java plugins. Try Chromium or QupZilla for example.

If you really want Java in Firefox, you can install Firefox ESR instead. Note that this one will not track regular Firefox version anymore, so your Firefox will grow old feature-wise, but still keep receiving security updates.

| improve this answer | |
  • 2
    There is a way to make standard Firefox support NPAPI plugins for a few more months; please see this answer. – Gunnar Hjalmarsson Apr 7 '17 at 9:26
  • Interesting. Question is though, will that work in Firefox 53? 54? As the other answer states, it's what keeps it going in ESR, but the ESR release will be remianing at 52.. probably for the very reason that it will be removed entirely in a future version. This is but speculation of course. – taifwa Apr 7 '17 at 12:43
  • My theory is that it will work as long as 52 is the latest ESR. But I don't really know. We'll know in a couple of weeks when Firefox 53 is released. – Gunnar Hjalmarsson Apr 7 '17 at 12:58
  • Regarding the first comment, that stopped working in Firefox 54. – i336_ Dec 17 '17 at 1:22
3

The following steps should work (tested on Mint 18 based on Ubuntu 16.04LTS):

  1. Download and extract the Firefox ESR install from here: https://www.mozilla.org/en-US/firefox/organizations/all/
  2. Launch Firefox and type about:config in the location bar
  3. Accept the risks and then add a key (right click mouse > New > Boolean)
  4. Call the key plugin.load_flash_only and set it to false
  5. Add a Firefox extension for switching the user agent eg. User-Agent Switcher
  6. Set the user agent to an earlier version of Firefox on Linux eg. Mozilla/5.0 (X11; Linux i586; rv:31.0) Gecko/20100101 Firefox/31.0
  7. Close Firefox
  8. Download the tar.gz JRE package for Linux on www.java.com and store the file in the folder Downloads in your home folder (ie. ~/Downloads). It will be of the form: jre-8u161-linux-i586.tar.gz for the 32 bit version. Choose the 32 bit or 64 bit version according to the version of Firefox ESR you downloaded.
  9. Then do the following to extract the JRE in a shell (replacing with 64 bit versions if needed):

    sudo mkdir -p -v /opt/java/32
    cd ~/Downloads
    tar -zxvf jre-8u161-linux-i586.tar.gz
    sudo mv -v jre1.8.0_* /opt/java/32
    
  10. Now the Java needs to be linked to Firefox. In a shell:

    mkdir -p ~/.mozilla/plugins/
    cd /opt/java/32/jre1.8.0_161
    ln -sf $PWD/lib/i386/libnpjp2.so ~/.mozilla/plugins/
    
  11. Launch Firefox and verify your Java version here: https://www.java.com/en/download/installed.jsp

  12. If it doesn't work and the wrong Java plugin appears to be loaded eg. IcedTea, then remove them in a shell:

    sudo apt-get remove icedtea-plugin
    sudo apt-get remove icedtea-8-plugin
    sudo apt-get remove icedtea-netx
    sudo apt-get remove icedtea-netx-common 
    
  13. If Firefox or Java or audio in Java don't work, there may be missing dependencies. Try the below (remove :i386 for 64 bit):

    sudo apt-get install libgtk-3-0:i386 libasound2:i386 libdbus-glib-1-2:i386 libxt6:i386 libxtst6:i386 libcanberra-gtk-module:i386 libcanberra-gtk3-module:i386 topmenu-gtk3:i386 libpangoxft-1.0-0:i386 libxft2:i386 libpangox-1.0-0:i386 libxmu6:i386 libxv1:i386 libasound2-plugins:i386
    
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.