官方:
https://www.oracle.com/java/technologies/downloads/#java17
1. 下载:
https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz
2. 存放目录
mkdir /usr/local/javacd /usr/local/java
3. 解压
tar -zxvf jdk-17_linux-x64_bin.tar.gz
4. 配置环境变量
vi ~/.bash_profile
添加配置:(注意路径)
export JAVA_HOME=/usr/local/java/jdk-17.0.12
export PATH=$JAVA_HOME/bin:$PATH
5. 环境配置生效:
source ~/.bash_profile
6. 验证安装成否:
java -version
END,感谢阅览~