Installing Sun Java jre on CentOS, SL6 etc.

Discussion in 'all things UNIX' started by Ocky, Mar 27, 2011.

Thread Status:
Not open for further replies.
  1. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,713
    Location:
    George, S.Africa
    Just to share how I did the install on Scientific Linux. (Yes, I need it for stock charts so can't do without unfortunately).

    Install sun jre SL6 (64bit version)

    Download the bin file jre-6u24-linux-x64.bin from https://cds.sun.com/is-bin/INTERSHO...ProductRef=jre-6u24-oth-JPR@CDS-CDS_Developer Save to Desktop.

    AS ROOT

    1. mv /home/yourusername/Desktop/jre-6u24-linux-x64.bin /opt/
    2. cd /opt/
    3. chmod +x jre-6u24-linux-x64.bin
    4. ./jre-6u24-linux-x64.bin (the./ means you will run the install script)
    5. cd /usr/sbin
    6. alternatives --install /usr/bin/java java /opt/jre1.6.0_24/bin/java 2
    7. cd /
    8. usr/sbin/alternatives --config java

    After completion of step 8. you should see something like this:-

    There is 1 program that provides 'java'.

    Selection Command
    -----------------------------------------------
    *+ 1 /opt/jre1.6.0_24/bin/java

    Enter to keep the current selection[+], or type selection number:
    [root@localhost /]#

    9. usr/sbin/alternatives --display java
    Tests to see all OK. You should get something like this:-

    java - status is manual.
    link currently points to /opt/jre1.6.0_24/bin/java
    /opt/jre1.6.0_24/bin/java - priority 2
    Current `best' version is /opt/jre1.6.0_24/bin/java.

    Now the browser links.

    Opera.

    Tools>Preferences>Advanced>Content>Plug-in Options>Change Path>Add
    Browse to /opt/jre1.6.0_24/lib/amd64
    OK>OK>OK

    Firefox.

    I made a soft link ..

    ln -s /opt/jre1.6.0_24/lib/amd64/libnpjp2.so /usr/lib64/mozilla/plugins/

    Check about:plugins

    Test the browser(s) http://www.java.com/en/download/help/testvm.xml

    Sun jre.png


    [I also did this although I am not sure whether needed. I have never needed it.
    (Also as root)

    gedit /etc/profile.d/java.sh

    Enter the following environment variables:

    export J2RE_HOME=/opt/jre1.6.0_24
    export PATH=$J2RE_HOME/bin:$PATH

    Add an empty line at the end of the file.]
     
  2. lodore

    lodore Registered Member

    Joined:
    Jun 22, 2006
    Posts:
    9,065
    it has always annoyed me there isnt an sun/oracle java repo
    i hate the fact you have to manually update one thing.
     
  3. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,713
    Location:
    George, S.Africa
    Me too.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.