wget https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz
tar -zvxf zulu21.32.17-ca-jdk21.0.2-linux_x64.tar.gz
sudo mv zulu21.32.17-ca-jdk21.0.2-linux_x64 /usr/local/java
sudo vim ~/.bashrc
# 添加以下两行
# export JAVA_HOME=/usr/local/java
# export PATH=$PATH:/usr/local/java/bin
# 保存并退出
source ~/.bashrc
java --version
以上为演示java21,如果需要其他版本,替换对应的版本名称即可
找到你需要的java版本并复制链接:https://www.azul.com/downloads/