英文:
How to downgrade Java -version in Mac
问题
tried the below commands in Mac Terminal and did not update the java version:
/usr/libexec/java_home -V
export JAVA_HOME=“System/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home”
Updated again
Fixed it ! export JAVA_HOME=/usr/libexec/java_home -v 11.0.8
worked
note:
- please use ` and not ' in your terminal command.
- also only: /usr/libexec/java_home takes effect and not the System/Library/Java/JavaVirtualMachines/.
Verified version afterwards using:
Java -version
validated and all good now.
Downgraded! Yay!
英文:
tried the below commands in Mac Terminal and did not update the java version:
/usr/libexec/java_home -V
export JAVA_HOME=“System/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home”
Updated again
Fixed it ! export JAVA_HOME=`/usr/libexec/java_home -v 11.0.8` worked
note:
- please use ` and not ' in your terminal command.
- also only: /usr/libexec/java_home takes effect and not the System/Library/Java/JavaVirtualMachines/.
Verified version afterwards using:
Java -version
validated and all good now.
Downgraded! Yay!
答案1
得分: 1
欢迎来到 Stack Overflow!
尽管您已经解决了这个问题,如果您想在不同版本之间进行频繁切换,使用 sdkman 可以极大地减轻压力。
英文:
Welcome to SO!
Even though you already solved it, using sdkman greatly reduces stress if you want to switch regularly between versions.
专注分享java语言的经验与见解,让所有开发者获益!
评论