To enable Oracle’s Java plugin in your Linux browsers, just copy these lines into a script, and run it!
ln -s $JAVA_HOME/jre/lib/i386/libnpjp2.so $MOZILLA_HOME/plugins
Note: You may need to change the value of JAVA_HOME so that it correctly points to your installation of the JDK. 64-bit users will need to change the final line to:
ln -s $JAVA_HOME/jre/lib/amd64/libnpjp2.so $MOZILLA_HOME/plugins
If you’re a newbie, here’s how to run the script:
- Using your favorite editor, paste the contents of the script into a new file.
- Find out where Oracle Java is installed. This location has the directories “bin”, “lib”, and “jre”, among others. Replace the value of JAVA_HOME with the path to this folder, and save the file. This step applies if you’re using the JDK. If you’re only using the JRE, let JAVA_HOME point to the jre installation directory (which contains the folders “bin”, “lib” and “plugin”), and modify the last line in the script to remove “jre” from the path.
- Make the script executable, by typing in
chmod +x <filename>
- Run the script using the command
- Restart your browser, and confirm your installation as shown in the next section
The above script will enable Java support in both Chrome/Chromium and Firefox, since they both use the
~/.mozilla/plugins directory to scan for available plugins.
After you’ve restarted your browser, if you see a message below detailing your installed Java version and operating system, you’ll know it’s working successfully.
You can also look up the address “about:plugins” in Chrome or Firefox to get the list of plugins installed in your browser.
Alternatively, look up Oracle’s How do I test whether Java is working on my computer? to confirm the version of Java your browser is using.
If you’re facing problems with your Java plugin not working correctly on certain sites, you might want to try updating Java to the latest version. Also, you could try switching to Oracle’s version (in case you’re running the OpenJRE or IBM’s JRE), since that’s what’s best supported on the web.