Java

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

本文访问量

本站总访问量

本站总访客数