Install JDK on Linux (CentOS)

1. download the .bin runnable file from sun.
2. use chmod and change the .bin to executable mode.
3. run it. example: ./jdk1.6.0_06.bin

and then it will install itself.

But CentOS use redhat jdk under /usr/bin/java
you can check it with this command: which java
To change this environment setting for bash shell, add this to your [userhome]/.bashrc

export PATH=/[javahome]/bin:$PATH
export JAVA_HOME=”/[javahome]”

if you install your jdk to /root/jdk1.6.0_06, the result will be
export PATH=/root/jdk1.6.0_06/bin:$PATH
export JAVA_HOME=”/root/jdk1.6.0_06″

beware the difference between linux and windows (since I am windows user).
windows use “;”, linux use “:”


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s