SDKMAN!关联已安装JDK
- 查看已经安装的JDK目录
xxx:~ xxx$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):17.0.6, x86_64: "Java SE 17.0.6" /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home11.0.10, x86_64: "Java SE 11.0.10" /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home1.8.0_181, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
- 安装本地已经安装好的JDK命令如下
# 注意版本不要跟sdk list java中展示的重复,否则无法关联,并且环境变量配置要移除,否则不生效
sdk install java 17.0.6 /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
- 本地已经安装好的JDK命令,左侧标记为Unclassified未经分类的JDK便是本地安装添加SDKMAN!管理的jdk,左侧有>>>标识当前默认版本
administrator:~ administrator$ sdk list java| | 22.3.5.r11 | nik | | 22.3.5.r11-nik Microsoft | | 21.0.4 | ms | | 21.0.4-ms | | 17.0.12 | ms | | 17.0.12-ms | | 11.0.24 | ms | | 11.0.24-ms Oracle | | 22.0.2 | oracle | | 22.0.2-oracle | | 21.0.4 | oracle | | 21.0.4-oracle | | 17.0.12 | oracle | | 17.0.12-oracle SapMachine | | 22.0.2 | sapmchn | | 22.0.2-sapmchn | | 21.0.4 | sapmchn | | 21.0.4-sapmchn | | 17.0.12 | sapmchn | | 17.0.12-sapmchn | | 11.0.24 | sapmchn | | 11.0.24-sapmchn Semeru | | 21.0.4 | sem | | 21.0.4-sem | | 21.0.3 | sem | | 21.0.3-sem | | 17.0.12 | sem | | 17.0.12-sem | | 17.0.11 | sem | | 17.0.11-sem | | 11.0.24 | sem | | 11.0.24-sem | | 11.0.23 | sem | | 11.0.23-sem | | 8.0.422 | sem | | 8.0.422-sem | | 8.0.412 | sem | | 8.0.412-sem Temurin | | 22.0.2 | tem | | 22.0.2-tem | | 21.0.4 | tem | | 21.0.4-tem | | 17.0.12 | tem | | 17.0.12-tem | | 11.0.24 | tem | | 11.0.24-tem | | 8.0.422 | tem | | 8.0.422-tem Tencent | | 17.0.12 | kona | | 17.0.12-kona | | 11.0.24 | kona | | 11.0.24-kona | | 8.0.422 | kona | | 8.0.422-kona Trava | | 11.0.15 | trava | | 11.0.15-trava | | 8.0.282 | trava | | 8.0.282-trava Zulu | | 22.0.2.fx | zulu | | 22.0.2.fx-zulu | | 22.0.2 | zulu | | 22.0.2-zulu | | 21.0.4.fx | zulu | | 21.0.4.fx-zulu | | 21.0.4 | zulu | | 21.0.4-zulu | | 17.0.12.fx | zulu | | 17.0.12.fx-zulu | | 17.0.12 | zulu | | 17.0.12-zulu | | 11.0.24.fx | zulu | | 11.0.24.fx-zulu | | 11.0.24 | zulu | | 11.0.24-zulu | | 8.0.422.fx | zulu | | 8.0.422.fx-zulu | | 8.0.422 | zulu | | 8.0.422-zulu | | 7.0.352 | zulu | | 7.0.352-zulu Unclassified | | 17.0.6 | none | local only | 17.0.6 | | 11.0.10 | none | local only | 11.0.10 | >>> | 1.8.0 | none | local only | 1.8.0
================================================================================
Omit Identifier to install default version 21.0.4-tem:$ sdk install java
Use TAB completion to discover available versions$ sdk install java [TAB]
Or install a specific version by Identifier:$ sdk install java 21.0.4-tem
Hit Q to exit this list view
================================================================================
- 关联管理成功后就可以正常使用SDKMAN!管理
# 设置默认JDK版本
sdk default java 17.0.6
# 查看当前jdk版本
sdk current java
官方网站:https://sdkman.io/
开源SDK:https://github.com/mingyang66/spring-parent