jdk1.8.0_192安装
1.上传安装包至目录/usr/local下;
2.解压安装包:tar -xvf jdk-8u192-linux-x64.tar.gz;
3.删除安装包:rm -rf jdk-8u192-linux-x64.tar.gz;
4.修改/etc/profile文件,在文件末尾加入如下几行:
export JAVA_HOME=/usr/local/jdk1.8.0_192
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
export PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin:$PATH
5.保存退出,执行source /etc/profile;
6.执行java -version查看版本是否正确
[root@localhost ~]# java -version
java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)