Java plugin no longer supported in firefox 52. Is there any other way to run java applets in firefox

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?


Solution 1:

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
    

Solution 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.