1.java引入临时环境变量
[root@host150 opt]# export JAVA_HOME=/root/mysoftwareInstall/jdk1.8/jdk1.8.0_131
[root@host150 opt]# export PATH=$JAVA_HOME/bin:$PATH
[root@host150 opt]# export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
2.查看临时环境变量引入
[root@host150 opt]# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)