下载JDK11
- 国内华为镜像下载:https://repo.huaweicloud.com/java/jdk/11.0.2+9/
- injdk 镜像下载:https://www.injdk.cn/
- 官网下载:https://www.oracle.com/java/technologies/downloads/#java11
个人使用华为镜像下载
安装
下载后上传至Linux主机上
1. cd /usr/local/
2. mkdir jdk
3. tar -zxvf jdk-11.0.2_linux-x64_bin.tar.gz
4. vim /etc/profile
5. 写入环境变量
export JAVA_HOME=/usr/local/jdk/jdk-11.0.2
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
6. source /etc/profile
7. java -version