如何在Mac上降级Java版本。

huangapple go评论74阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2020年7月24日 06:32:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/63064072.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定