Feb 24 2008

Sun Java on Fedora 8

Published by Bill at 12:45 pm under Linux

I seem to struggle with installing Sun’s Java on Fedora every time. Here are the quick steps to get it working including the Firefox plug-in. I hope this helps someone.

  1. Download Java from Sun as a self extracting rpm.
  2. Remove java icedtea if it’s installed
    • sudo yum -y remove java-*-icedtea java-*-icedtea-devel java-*-icedtea-plugin
  3. Install Java and answer yes to the license agreement (this is for version 6 update 3, you will need to adjust the filename to match the version you downloaded)
    • sudo sh ./jre-6u3-linux-i586-rpm.bin
  4. You will need the following packages to get the Firefox plug-in to work
    • sudo yum -y install compat-libstdc++-33 compat-libstdc++-296
  5. Now symlink the plug-in (this is for Firefox 2.0.0.12 so you will need to adjust the path for your version of Firefox
    • cd /usr/lib/firefox-2.0.0.12/plugins && sudo ln -s /usr/java/latest/jre/plugin/i386/ns7/libjavaplugin_oji.so
  6. Setup alternatives to point to Sun’s Java
    • sudo /usr/sbin/alternatives –install /usr/bin/java java /usr/java/latest/bin/java 2 /usr/sbin/alternatives –config java
    There are 2 programs which provide 'java'.
    Selection    Command
    -----------------------------------------------
    *+ 1        /usr/lib/jvm/jre-1.5.0-gcj/bin/java
    2           /usr/java/latest/bin/java
    
    Enter to keep the current selection[+], or type selection number: 2
  7. Verify that the correct version of Java is being used
    • java -version
    java version "1.6.0_04"
    Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
    Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode)

That should do it. Please let me know if you have any questions or find any problems with this little how-to.

Trackback URI | Comments RSS

Leave a Reply