Installing Sun JRE 6u12 on Ubuntu Intrepid 8.10

Feb 15th
Posted by Michael Trausch  as computing

Just a quick set of notes I accumulated earlier when I installed the new JRE on a couple of 64-bit (AMD64) Intrepid machines.

  1. Download the JRE or the JDK for 6u12 from Sun Microsystem’s Java download page. Select the bin option, NOT the RPM.
  2. Save the file to your home directory.
  3. When the download is complete, open a terminal and enter:

    • chmod +x jre-6u12-linux-x64.bin
    • sudo mkdir /opt; cd /opt
    • sudo ~/jre-6u12-linux-x64.bin
  4. Type “q” and then type “yes” followed by to accept the license agreement, and the software will now extract in /opt/jre1.6.0_12
  5. Tell Ubuntu how to use it:

    • sudo update-alternatives --install /usr/bin/java java /opt/jre1.6.0_12/bin/java 1
    • sudo update-alternatives --install /usr/lib/xulrunner/plugins/javaplugin.so xulrunner-1.9-javaplugin.so /opt/jre1.6.0_12/lib/amd64/libnpjp2.so 1
    • sudo update-alternatives --install /usr/bin/javaws javaws /opt/jre1.6.0_12/bin/javaws 1
    • If you downloaded the JDK, set up links for javac this way, too.
  6. Tell your Ubuntu system to use the new JRE:

    • sudo update-alternatives --set java /opt/jre1.6.0_12/bin/java
    • sudo update-alternatives --set xulrunner-1.9-javaplugin.so /opt/jre1.6.0_12/lib/amd64/libnpjp2.so
    • sudo update-alternatives --set javaws /opt/jre1.6.0_12/bin/javaws
  7. Restart Firefox, and verify that it works:
    • Type “about:plugins” in the address bar, and you should see a bunch of stuff for Java there.
    • Go to the Java Version Tester. It should tell you that you are running Java Version 1.6.0_12 from Sun Microsystems Inc.

There you have it—a functioning Sun JVM in your 64-bit Web browser. It’s about damn time, Sun!

Also, you will want to run *.jnlp files with “javaws”. You can do that in whatever your file manager is, and you may also need to do that with your browser (say, Firefox). There are instructions for Nautilus in the comments below.

7 Comments

  1. Dana  16th February 2009  

    Thank you for the very detailed step-by-step description of all actions, because sometimes some of it is very difficult to install and it requires special expertise.

  2. Michael Trausch  16th February 2009  

    @Dana: You are quite welcome. I am glad that this was helpful!

  3. Chris Green  11th March 2009  

    There’s a minor typo in the instructions above:-

    This is correct: sudo update-alternatives –install /usr/lib/xulrunner/plugins/javaplugin.so xulrunner-1.9-javaplugin.so /opt/jre1.6.0_12/lib/amd64/libnpjp2.so 1

    But this isn’t: sudo update-alternatives –set xulrunner-1.9.javaplugin.so /opt/jre1.6.0_12/lib/amd64/libnpjp2.so

    Notice that xulrunner-1.9-javaplugin.so in the first has changed to xulrunner-1.9.javaplugin.so in the second, the – has changed to a ., It took me ages to spot this! :-)

    Thanks for the instructions though.

  4. Michael Trausch  11th March 2009  

    @Chris: Thanks for spotting that. I have updated the instructions now. This is why you don’t retype things, lol

  5. Cameron  14th March 2009  

    Running the bin file required root authority, so for those who can’t get it installed, run sudo ~/jre-6u12-linux-x64.bin

    In order for firefox to properly find the plugin, I had to create a symlink from the plugin to my plugins folder for mozilla. (/usr/lib/mozilla/plugins)

    You also forgot Java Web Start for *.jnlp files.

    Run these:

    sudo update-alternatives --install /usr/bin/javaws javaws /opt/jre1.6.0_12/bin/javaws 1
    sudo update-alternatives --set javaws /opt/jre1.6.0_12/bin/javaws

    Then, in your favorite file manager, associate jnlp files to javaws. For nautilus, right click on any jnlp, select ‘properties’. Then, go to the ‘open with’ tab, Press ‘Add’, ‘use a custom command’ and then type ‘javaws’

  6. Michael Trausch  17th March 2009  

    @Cameron: Thanks for the corrections. I didn’t think about Java Web Start—I forgot that was still used, actually. :) I’ll update the post momentarily.

  7. utgarda  18th March 2009  

    Yep, since I was unable to find sun-java6-plugin package for Ubuntu AMDx64, before checking plugins in firefox, one has to create the link manually :

    sudo ln -s /etc/alternatives/xulrunner-1.9-javaplugin.so /usr/lib/mozilla/plugins/libjavaplugin.so

    Thanks a lot for the guide :) Maybe you could add this step before #7

Leave a Reply

Powered By Wordpress || Designed By Ridgey