Tip: Getting Java on Google Chrome for Linux

Share this:

I’ve recently jumped on the Linux bandwagon and installed Linux Mint as the primary OS on my work machine. Cutting the long story short, I installed Chrome and discovered that it didn’t have the Java plugin pre-installed. Bummer.

So naturally, I went to download the latest Java runtime for Linux (jre-6u18-linux-x64.bin) here and installed it at /opt/java. For you Linux newbies, I’ll go easy on you as I too was a Linux n00b not too long ago 🙂

Make a new directory for your JRE install and move the downloaded jre-6u18-linux-x64.bin to the new directory

sudo mkdir /opt/java
sudo mv jre-6u17-linux-i586.bin /opt/java

Add the permissions to allow the bin file to be executed, then execute it.

cd /opt/java
sudo chmod +x jre-6u17-linux-i586.bin
sudo ./jre-6u17-linux-i586.bin

Then follow the instructions and get the installation done and over with.

And you’d wish that the installation would recognize any installed browser, in this case Chrome, and automatically install the Java plugins to the browser right? Well, fat chance. LOL!

After scouring the Internet, I found out that apparently, there’s two things that you’d need to do.

Firstly, you need to ensure the enabled JRE is the one you’ve downloaded for your user. To do this, just use the Java Control Panel to set it.

The easiest method is to just access it from your GUI.

Or you can always start it from the terminal.

cd /opt/java/jre1.6.0_18/bin/
ControlPanel

Once the Java Control Panel, click on the Java Tab, then click on View… to add in the location of the JRE.

Click Find and search for the /opt/java/jre1.6.0_18.

Click Next and Finish. Now the make sure that only the new JRE is enabled by un-checking any other JRE that’s already enabled.

Click OK and Apply the changes. With this, the first step is now done. Now your user would be using the JRE you’ve just installed. Next, you’d need to copy over the Java plugin and enable it to work on Chrome. Just follow the following steps and you’ll be able to run Java components on the web!

Create a plugins directory in Google Chrome’s directory if it does not already exist.

sudo mkdir /opt/google/chrome/plugins

Then, create a symbolic link of the libnpjp2.so library in the plugins directory

cd /opt/google/chrome/plugins
ln -s /opt/java/jre1.6.0_18/lib/amd64/libnpjp2.so .

Note: If you’ve installed the 32-bit JRE, then the lib is likely to be in the /opt/java/jre1.6.0_18/lib/i386/ directory.

Lastly, run Chrome with the following command options to enable the plugins.

google-chrome –enable-plugins %U

That’s it. You now can run Java components on Chorome! In order to validate your Java installation, just point Chrome here and the Java JRE version would be verified.

Share this:

You may also like...

8 Responses

  1. Hello says:

    Doesnt work.

  2. Anonymous says:

    What error did you get?

  3. Stig says:

     Perfect, works with latest chrome 11 stable on ubuntu 9.10. I installed jre1.6.0_25 in /usr/java and made a symbolic link to /usr/java/jre1.6.0_25/lib/i386/libnpjp2.so from the plugin folder as specified. For me it works without the –enable-plugins option. Thanks very much!

  4. Thank you so much! Worked great! Only gripe is that (at least, with Chromium) I had to replace /opt/google/chrome with /usr/lib/chromium-browser.

  5. Roddy6667 says:

    This is waaaaay too complicated.

  6. Ken Ng says:

    Well, in the world of Linux, it’s actually not that bad. Haha.

  7. Jonny D says:

    Do you not have Java and Java plugin packages already in Mint’s repositories?

    On Ubuntu, icedtea-plugin works automatically with Chrome and there’s probably a set of packages which do not use OpenJDK.

  8. Anynomous says:

    sorry, i got to the point of making the symbolic link and it said denied

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.