# Edit the profile
$vi /etc/profile
# Write down the environment variable with vi editor, and then save
JAVA_HOME=/usr/lib/jvm/jdk1.6.0_45
export $JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
# Apply the profile
$source /etc/profile
Link : http://blog.naver.com/blueday9404?Redirect=Log&logNo=220143471554