安装JDK
- 下载
wget url
- 解压
tar -xvf xxx
配置环境
JDK8_PATH=/usr/local/lib/jdk1.8.0_401/bin
JDK17_PATH=/usr/local/lib/jdk-17.0.10/bin
export PATH=$JDK8_PATH:$PATH
alias jdk8='export PATH=$(echo $PATH | sed "s|:$JDK17_PATH:|:|"); export PATH=$(echo $PATH | sed "s|:$JDK8_PATH:|:|"); export PATH=$JDK8_PATH:$PATH; java -version'
alias jdk17='export PATH=$(echo $PATH | sed "s|:$JDK8_PATH:|:|"); export PATH=$(echo $PATH | sed "s|:$JDK17_PATH:|:|"); export PATH=$JDK17_PATH:$PATH; java -version'
```
![使用效果](https://img-blog.csdnimg.cn/direct/f4f349ae4a4e4cedad92dbaa9cb31aab.png)