Sun Java Setup Notes on Centos x64

Language butchery by Mr Rich on  24.1.11 @ 09:58

Some notes for the next time I do this:
  1. Find OpenJDK related packages. Take some notes as to what alternatives lists; you'll be setting this up later to point correctly to Sun Java
    yum list installed jre
    yum list installed jdk
    yum list installed gcj
    ll /etc/alternatives/j*
  2. Uninstall OpenJDK related:
    yum remove jre
    yum remove /* other java related packages */
  3. Get the JDK for x_64 from Oracle ( ); install as root as directed on site.
    Take note of where Java installs to; you'll need it for re-pointing alternatives!
  4. Delete (if necessary) and make a soft link:
    ln -s [location where Java installed] /usr/java/latest
  5. Re-point alternatives (as root):
    /usr/sbin/alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 1
    /usr/sbin/alternatives --install /usr/bin/jarsigner jarsigner /usr/java/latest/bin/jarsigner 1
    /usr/sbin/alternatives --install /etc/alternatives/java java /usr/java/latest/bin/java 1
    /usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 1
    /usr/sbin/alternatives --install /usr/bin/javadoc javadoc /usr/java/latest/bin/javadoc 1
    /usr/sbin/alternatives --install /usr/bin/javah javah /usr/java/latest/bin/javah 1
    /usr/sbin/alternatives --install /usr/bin/java_sdk java_sdk /usr/java/latest 1
    /usr/sbin/alternatives --install /usr/bin/jre jre /usr/java/latest/jre/ 1
    (... and anything else that needs to be re-pointed from the list step above)
  6. Verify your setup:
    java -version
    javac -version
    ls /etc/alternatives/j*
  7. Setup the browser plugin for Firefox (these directions differ from those on Oracle's site):
    (as root): cd /usr/lib64/mozilla/plugins
    ln -s /usr/java/latest/jre/lib/amd64/ .
  8. If necessary, you may also need to setup the link to the Java plugin as the user:
    (not super-user): cd ~/.mozilla/plugins
    ln -s /usr/java/latest/jre/lib/amd64/ .
Finally, you'll probably also want to get the Flash plugin installed for the browser. Adobe has a some funky links on the site (as of this posting anyway), so it takes a bit of rooting around in there to find what you are looking for:
  1. Site where found:
  2. File desired: flashplayer10_2_p3_64bit_linux_111710.tar.gz
    Make sure you get the 64 bit version! The typical download location on Adobe's site doesn't list the 64 bit version!
  3. As root, unpack the tarball into the mozilla plugin directory (where you created the link for the Java plugin above) and make it executable:
    tar -zxvf flashplayer10_2_p3_64bit_linux_111710.tar.gz -C /usr/lib64/mozilla/plugins
    chmod +x /usr/lib64/mozilla/plugins/

Comments: Post a Comment

Links to this post:

Create a Link

<< Home

This page is powered by Blogger. Isn't yours?