心情乱糟糟,写个流水账吧
tar -zxvf jdk1.8.0_111.tar.gz -C /app/ #将JDK解压
ln -s /app/jdk1.8.0_111/ /app/java #软连接
sudo vim /etc/profile #环境变量
[lee@localhost app]$ tail -5 /etc/profile
export JAVA_HOME=/app/java
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
[lee@localhost app]$ source /etc/profile #别忘了骚死一下
[lee@localhost app]$ java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)