kotlinÅçü部分10 -macâ§openjdk - java_homeâ
#java #kotlin #mac #env

为什么

kotlin - Springbootâ§Å openjdkâÉé -é -â€
asdfââ€Ééém


卢森堡讯


ASDFâdl

https://asdf-vm.com/guide/getting-started.html#_1-install-dependencies

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.1

git克隆


asdfâ€和¾¼é址错误

. "$HOME/.asdf/asdf.sh"

.zshrcâ«â€â†ÅVount 完成â®èâŮ‸ -

asdf list
No plugins installed

â·§ -



javaâ®开放jdk 17 -


asdf - javaâ©

asdf plugin-add java

asdf list
java
  No versions installed

javaâ® â¾ -â® p>


ASDFâ®开放jdk⪪

asdf list-all java | grep openjdk-1 

...

openjdk-10
...
openjdk-19.0.2

openjdkâ10〜19.0.2â€â€


打开JDK 17.0.2

asdf install java openjdk-17.0.2
...
openjdk-17.0.2_macos-x64_bin.tar.gz: OK

ä¥é秧§£17.0.2可

asdf list
java
  openjdk-17.0.2

OpenJDK-17.0.2ã1°äºä««««ä«ä«äääViT。CevedOvcevedoóã°11111111111111111)。


javaâ€â€®

java

No version is set for command java                                                       
Consider adding one of the following versions in your config file at 
java openjdk-17.0.2

ç¾µ® -

asdf global java openjdk-17.0.2

⪮- Å美 -

java --version
openjdk 17.0.2 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)

asdf which java
/Users/kaede0902/.asdf/installs/java/openjdk-17.0.2/bin/java

ã !ãjara -ussout



JAVA_HOME を通す

echo $JAVA_HOME

Åè?°â®
java_homeã

https://github.com/halcyon/asdf-java

‮ÅIbouth

. ~/.asdf/plugins/java/set-java-home.zsh

- z -

$JAVA_HOME
/Users/kaede0902/.asdf/installs/java/openjdk-17.0.2

†java_home - ã