Neurohazard
暮雲煙月,皓首窮經;森羅萬象,如是我聞。

Java JDK 多版本快速切换

wpadmin~January 5, 2020 /System Management

Contents

Java JDK 多版本快速切换

可以考虑使用 sdkman

https://sdkman.io/install

SSL 问题

sdkman_insecure_ssl=true in ~/.sdkman/etc/config

添加本地版本

sdk list java
sdk install java 8-oracle /Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home
sdk install java 7-oracle /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
sdk install java 11-oracle /Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home
sdk install java 8.0.232-open
# 默认安装路径为 ~/.sdkman/candidates/java/8.0.232-open/bin/java

切换 Java 版本

sdk use java 8-oracle
sdk use java 7.0.191-zulu
sdk u java 8.0.232-open

参考资料

https://sdkman.io/usage#installdefault

Leave a Reply

Your email address will not be published. Required fields are marked *