1,安装jdk
下载地址: 根据自己的系统版本下载对应的版本号
安装:
1 我下载到了/usr/local/下 2 解压: 3 tar -zxvf jdk-8u111-linux-x64.tar.gz 4 配置: 5 vim /etc/profile.d/java.sh 6 JAVA_HOME=/usr/local/jdk1.8.0_111 7 JAVA_BIN=/usr/local/jdk1.8.0_111/bin 8 JRE_HOME=/usr/local/jdk1.8.0_111/jre 9 PATH=$PATH:/usr/localjdk1.8.0_111/bin:/usr/local/jdk1.8.0_111/jre/bin10 CLASSPATH=/usr/local/jdk1.8.0_111/jre/lib:/usr/local/jdk1.8.0_111/lib:/usr/local/jdk1.8.0_111/jre/lib/charsets.jar
加载下:source /etc/profile.d/java.sh
查看:
1 [root@master jdk1.8.0_111]# java -version2 java -version3 java version "1.8.0_111"4 Java(TM) SE Runtime Environment (build 1.8.0_111-b14)5 Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
成功