Java
#
apt install default-jdk
# lts version
sudo apt install -y openjdk-8-jdk
sudo apt install -y openjdk-11-jdk
sudo apt install -y openjdk-17-jdk
# list java versions
update-java-alternatives --list
# java-1.8.0-openjdk-amd64 1081 /usr/lib/jvm/java-1.8.0-openjdk-amd64
# java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64
# java-1.17.0-openjdk-amd64 1711 /usr/lib/jvm/java-1.17.0-openjdk-amd64
cat << EOF >> ~/.zshrc
# switch java version
alias javato8="update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64"
alias javato11="update-java-alternatives --set /usr/lib/jvm/java-1.11.0-openjdk-amd64"
alias javato17="update-java-alternatives --set /usr/lib/jvm/java-1.17.0-openjdk-amd64"
EOF
zsh
叶王 © 2013-2024 版权所有。如果本文档对你有所帮助,可以请作者喝饮料。