系统运输
1、下载JDK 11 lts:https://www.Oracle.com/tech network/Java/Java se/downloads/JDK 11-downloads-5066655.html
2、安装JDK 11 TLS :
# rpm-ivhjdk-11.0.6 _ Linux-x64 _ bin.rpm
# java -version
或者
# tar-xf JDK-11.0.6 _ Linux-x64 _ bin.tar.gz-c/usr/local
# cd /usr/local
# mv jdk-11.0.6/jdk
设置JDK环境变量:
# vim /etc/profile.d/jdk11.sh
export JAVA_HOME=/usr/local/jdk
export JRE_HOME=$JAVA_HOME
export class path=. $ Java _ home/lib
export path=$ Java _ home/bin:$ path
# . /etc/profile.d/jdk11.sh
# java -version
3、从多个JDK版本中选择JDK 11 LTS作为默认版本:
# alternativesconfig Java
注:缺省情况下,只有以前使用rpm软件包安装的JDK 8
# alternativesinstall/usr/bin/javajava/usr/local/JDK/bin/Java 1
备注: alternatives [ options ]installinknamepathpriority
# alternativesconfig Java
详情请访问云服务器、域名注册、虚拟主机的问题,请访问西部数码代理商官方网站: www.chenqinet.cn