在/etc/profile 中写入下面或者用户目录下的profile
执行 source /etc/profile
export JAVA_HOME=/software/jdk1.8.0_111
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH
在/etc/profile 中写入下面或者用户目录下的profile
执行 source /etc/profile
export JAVA_HOME=/software/jdk1.8.0_111
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH