◆以root身份打开并编辑profile文件[sudo gedit /etc/profile]
◆在profile文件最后添加
#set java environment
JAVA_HOME=/home/liyouliang/develop/jdk1.6.0_14
export JRE_HOME=/home/liyouliang/develop/jdk1.6.0_14/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH