Enable Oracle Java in Your Web Browsers on Ubuntu Linux

This document covers enabling 32-bit and 64-bit Oracle Java browser plugin in 32-bit Ubuntu Linux and 64-bit Ubuntu Linux. For the two most popular web browsers for Ubuntu Linux at this time, which are Google Chrome and Mozilla Firefox. Included with the distribution of Oracle Java there is a plug-in to enable Java applets to run in your web browser known as libnpjp2.so. Also, this article assumes you have Oracle Java already installed on your Ubuntu Linux system in the /usr/local/java directory. If not, see the following article below for more information.

If you have Oracle Java already installed on your system please see the following article for Oracle Java upgrade information:

Important Note: I would urge caution when enabling Oracle Java 7 in your web browsers, due to the fact there have been many numerous security flaws and exploits. Essentially, by enabling Oracle Java 7 in your web browsers if a security flaw or exploit is discovered this is how the bad guys break in and compromise your system. For more information on security flaws and exploits in Java see the following website: Java Tester

Steps

  1. To enable your Java plug-in in your web browsers you must make a symbolic link from the web browsers plug-in directory to the location of the Java plug-in included in your distribution of Oracle Java.

Google Chrome

32-bit Oracle Java instructions:

  1. Issue the following commands.
    • Type/Copy/Paste: sudo mkdir /opt/google/chrome/plugins
      • this will create a directory called /opt/google/chrome/plugins
    • Type/Paste/Copy: cd /opt/google/chrome/plugins
      • this will change you into the google chrome plugins directory,make sure you are in this directory before you make the symbolic link
    • Type/Paste/Copy: sudo ln -s /usr/local/java/jre1.7.0_40/lib/i386/libnpjp2.so
      • this will create a symbolic link from the Java JRE( Java Runtime Environment ) plugin libnpjp2.so to your Google Chrome web browser

64-bit Oracle Java instructions:

  1. Issue the following commands.
    • Type/Copy/Paste: sudo mkdir /opt/google/chrome/plugins
      • this will create a directory called /opt/google/chrome/plugins
    • Type/Paste/Copy: cd /opt/google/chrome/plugins
      • this will change you into the google chrome plugins directory,make sure you are in this directory before you make the symbolic link
    • Type/Paste/Copy: sudo ln -s /usr/local/java/jre1.7.0_40/lib/amd64/libnpjp2.so
      • this will create a symbolic link from the Java JRE( Java Runtime Environment ) plugin libnpjp2.so to your Google Chrome web browser

Reminders:

  1. Note: Sometimes when you issue the above command you may receive a message which states:
    • ln: creating symbolic link `./libnpjp2.so': File exists
    • To correct this issue simply remove the previous symbolic link using the following command:
    • Type/Copy/Paste: cd /opt/google/chrome/plugins
    • Type/Copy/Paste: sudo rm -rf libnpjp2.so
    • Make sure you are in the /opt/google/chrome/plugins directory before you issue the command
  2. Restart your web browser and go to Java Tester to test if Java is functioning in your web browser.

Mozilla Firefox

32-bit Oracle Java instructions:

  1. Issue the following commands.
    • Type/Paste/Copy: cd /usr/lib/mozilla/plugins
      • this will change you into the directory /usr/lib/mozilla/plugins, create this directory if you do not have it
    • Type/Paste/Copy: sudo mkdir /usr/lib/mozilla/plugins
      • this will create the directory /usr/lib/mozilla/plugins, make sure you are in this directory before you make the symbolic link
    • Type/Paste/Copy: sudo ln -s /usr/local/java/jre1.7.0_40/lib/i386/libnpjp2.so
      • this will create a symbolic link from the Java JRE( Java Runtime Environment ) plugin libnpjp2.so to your Mozilla Firefox web browser

64-bit Oracle Java instructions:

  1. Issue the following commands.
    • Type/Paste/Copy: cd /usr/lib/mozilla/plugins
      • this will change you into the directory /usr/lib/mozilla/plugins, create this directory if you do not have it
    • Type/Paste/Copy: sudo mkdir /usr/lib/mozilla/plugins
      • this will create the directory /usr/lib/mozilla/plugins, make sure you are in this directory before you make the symbolic link
    • Type/Paste/Copy: sudo ln -s /usr/local/java/jre1.7.0_40/lib/amd64/libnpjp2.so
      • this will create a symbolic link from the Java JRE( Java Runtime Environment ) plugin libnpjp2.so to your Mozilla Firefox web browser

Reminders:

  1. Note: Sometimes when you issue the above command you may receive a message which states:
    • ln: creating symbolic link `./libnpjp2.so': File exists
    • To correct this issue simply remove the previous symbolic link using the following command:
    • Type/Copy/Paste: cd /usr/lib/mozilla/plugins
    • Type/Copy/Paste: sudo rm -rf libnpjp2.so
    • Make sure you are in the /usr/lib/mozilla/plugins directory before you issue the command
  2. Restart your web browser and go to Java Tester to test if Java is functioning in your web browser.

Related Articles