Linux 安装JDK1.8
三板斧
查看是否已安装过版本
有:卸载
无:上传、解压、配置
查看是否已安装过版本
[root@promote java]
openjdk version "1.8.0_131"
OpenJDK Runtime Environment ( build 1. 8. 0_131- b12)
OpenJDK 64- Bit Server VM ( build 25. 131- b12, mixed mode)
卸载安装过或者自带的版本
[root@promote java]
java- 1. 7. 0- openjdk- 1. 7. 0. 141- 2. 6. 10. 5. el7. x86_64
java- 1. 8. 0- openjdk- headless- 1. 8. 0. 131- 11. b12. el7. x86_64
tzdata- java- 2017b- 1. el7. noarch
javapackages- tools- 3. 4. 1- 11. el7. noarch
java- 1. 8. 0- openjdk- 1. 8. 0. 131- 11. b12. el7. x86_64
python- javapackages- 3. 4. 1- 11. el7. noarch
java- 1. 7. 0- openjdk- headless- 1. 7. 0. 141- 2. 6. 10. 5. el7. x86_64
[root@promote java]
[root@promote java]
[root@promote java]
[root@promote java]
[root@promote java]
[root@promote java]
[root@promote java]
上传
[root@promote java]
jdk- 8u161- linux- x64. tar. gz
解压
[root@promote java]
[root@promote java]
jdk1. 8. 0_161 jdk- 8u161- linux- x64. tar. gz
配置
[root@promote jdk1.8.0_161]
[root@promote jdk1.8.0_161]
[root@promote jdk1.8.0_161]
java version "1.8.0_161"
Java( TM) SE Runtime Environment ( build 1. 8. 0_161- b12)
Java HotSpot( TM) 64- Bit Server VM ( build 25. 161- b12, mixed mode)
配置环境变量
export JAVA_HOME= /usr/local/java/jdk1.8.0_161
export CLASSPATH= .:$JAVA_HOME /lib/dt.jar:$JAVA_HOME /lib/tools.jar
export PATH= $JAVA_HOME /bin:$PATH