MacOS java多版本安装与管理-sdkman
安装sdkman
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk version
正常出现sdkman版本号就安装成功了
# 安装java
# 安装java8
sdk install java 8.0.412.fx-zulu
建议和上述一样安装 fx-zulu 的jdk,这样会自带JAVAFX,方便后续使用java工具
ln -s ~/.sdkman/candidates/java/8.0.412.fx-zulu ~/.sdkman/candidates/java/8
sdk use java 8
java -version
# 安装jdk11
sdk install java 11.0.23.fx-zulu
ln -s ~/.sdkman/candidates/java/11.0.23.fx-zulu ~/.sdkman/candidates/java/11
sdk use java 11
java -version
# 安装jdk22
sdk install java 22.0.1.fx-zulu
ln -s ~/.sdkman/candidates/java/22.0.1.fx-zulu ~/.sdkman/candidates/java/22
sdk use java 22
java -version
# 版本切换
切换java8
sdk use java 8
java -version
切换java11
sdk use java 11
java -version
切换java22
sdk use java 22
java -version
原文地址:https://blog.csdn.net/YJ_12340/article/details/143690106
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!