Install Java for Firefox and Chrome on Ubuntu

Usually ubuntu-restricted-extras should work for you, like phunehehe mentioned.

Since Ubuntu 10.4 the sun-java* packages have moved from the «Multiverse Repository» to the «Partner Repositories».

Add the partner repositories to your package sources and you should be able install sun-java6-jreand sun-java6-plugin.

See «Adding Canonical Partner Repositories» int the ubuntu wiki.

To install Java you will have to decide if you want the OpenJDK or the Sun/Oracle Version. Java by itself is platform independent, but sometimes developers write applications which have dependencies to com.sun.* packages. These packages are only available in the HotSpot VM, which is the virtual machine of the Sun/Oracle Java distribution. To be on the safe side, you should use the Sun/Oracle Java version.

You need to remove (if installed) icedtea-6-jre-cacao and icedtea6-plugin before next step.

32-bit is available as package from the partner repository, 64-bit not yet, as far as I know and must be installed by hand:

  • Download your Version (32-bit or 64-bit) from the Oracle Download Page.
  • Create a folder for the installation (e.g.: /usr/java/jre1.6.0_24)
  • Install the .bin file: 
    sudo ./jre-6uxx-linux-x64.bin
  • Don’t forget to tell your system about the new java version with 
    sudo update-alternatives --install "/usr/bin/java" "java" "/usr/java/jre1.6.0_24/bin/java" 1

    and 

    sudo update-alternatives --set java /usr/java/jre1.6.0_24/bin/java

These are the steps to install a JRE on your system.

Now you have to install the plugin to the browser:

Firefox:

  • If it doesn’t exist, create 
    mkdir ~/.mozilla/plugins
  • Link the plugin: 
    ln -s /usr/java/jre1.6.0_24/lib/amd64/libnpjp2.so ~/.mozilla/plugins/
  • Or
    sudo ln -s /usr/java/jre1.6.0_24/lib/amd64/libnpjp2.so /usr/lib/firefox-addons/plugins/

 

Chrome:

  • If it doesn’t exist, create 
    mkdir /opt/google/chrome/plugins
  • Link 
    ln -s /usr/java/jre1.6.0_24/lib/amd64/libnpjp2.so /opt/google/chrome/plugins

Comments are closed.