How To Install Sun Java JDK on CentOS 5.5

Installing Sun Java JDK in CentOS 5.2


Download the Sun Java JDK from the Java SE Downloads page.

Using your root account, or the sudo command, run the jdk-6u11-linux-i586-rpm.bin (chmod it if necessary). This will install Java packages.

Type java -version. In my case, it show gcj info instead of Sun one.
For selecting the java command, we can use the alternatives program. Use:

/usr/sbin/alternatives --install /usr/bin/java java /usr/java/latest/bin/java 2

Now run

/usr/sbin/alternatives --config java

and select option 2.

Running java -version now should show Sun JVM info.

Remember that maybe you want to do the same with javac and other Java commands.

Hope this helps.

1 comments:

  1. This method doesnt seem to work for me.
    The other version has apparently not installed.
    Can you post the latest method in a more detailed way.
    Thanks.

    ReplyDelete