Mac set default java version:修订间差异
建立內容為「<source lang="bash"> /usr/libexec/java_home -V export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_281` </source> Category:Linux/Unix」的新頁面 |
无编辑摘要 |
||
(未显示同一用户的3个中间版本) | |||
第1行: | 第1行: | ||
< | |||
/usr/libexec/java_home -V | <syntaxhighlight lang="bash"> | ||
export JAVA_HOME=`/usr/libexec/java_home -v | $ /usr/libexec/java_home -V | ||
</ | Matching Java Virtual Machines (2): | ||
23 (x86_64) "Oracle Corporation" - "Java SE 23" /Library/Java/JavaVirtualMachines/jdk-23.jdk/Contents/Home | |||
21.0.4 (x86_64) "Oracle Corporation" - "Java SE 21.0.4" /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home | |||
$ export JAVA_HOME=`/usr/libexec/java_home -v 21.0.4` | |||
</syntaxhighlight> | |||
然后修改~/.zshrc | |||
<syntaxhighlight lang="bash"> | |||
export JAVA_HOME=`/usr/libexec/java_home -v 21.0.4` | |||
</syntaxhighlight> | |||
[[Category:Linux/Unix]] | [[Category:Linux/Unix]] |
2024年9月20日 (五) 09:26的最新版本
$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
23 (x86_64) "Oracle Corporation" - "Java SE 23" /Library/Java/JavaVirtualMachines/jdk-23.jdk/Contents/Home
21.0.4 (x86_64) "Oracle Corporation" - "Java SE 21.0.4" /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home
$ export JAVA_HOME=`/usr/libexec/java_home -v 21.0.4`
然后修改~/.zshrc
export JAVA_HOME=`/usr/libexec/java_home -v 21.0.4`