SDKMAN!关联已安装JDK

  • 查看已经安装的JDK目录
sh 复制代码
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/Home
    11.0.10, x86_64:	"Java SE 11.0.10"	/Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home
    1.8.0_181, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
  • 安装本地已经安装好的JDK命令如下
sh 复制代码
# 注意版本不要跟sdk list java中展示的重复,否则无法关联,并且环境变量配置要移除,否则不生效
sdk install java 17.0.6 /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
  • 本地已经安装好的JDK命令,左侧标记为Unclassified未经分类的JDK便是本地安装添加SDKMAN!管理的jdk,左侧有>>>标识当前默认版本
sh 复制代码
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!管理
sh 复制代码
# 设置默认JDK版本
sdk default java 17.0.6
# 查看当前jdk版本
sdk current java

官方网站:https://sdkman.io/

开源SDK:https://github.com/mingyang66/spring-parent

相关推荐
Theodore_10224 小时前
4 设计模式原则之接口隔离原则
java·开发语言·设计模式·java-ee·接口隔离原则·javaee
冰帝海岸5 小时前
01-spring security认证笔记
java·笔记·spring
世间万物皆对象5 小时前
Spring Boot核心概念:日志管理
java·spring boot·单元测试
没书读了6 小时前
ssm框架-spring-spring声明式事务
java·数据库·spring
小二·6 小时前
java基础面试题笔记(基础篇)
java·笔记·python
开心工作室_kaic6 小时前
ssm161基于web的资源共享平台的共享与开发+jsp(论文+源码)_kaic
java·开发语言·前端
懒洋洋大魔王6 小时前
RocketMQ的使⽤
java·rocketmq·java-rocketmq
武子康7 小时前
Java-06 深入浅出 MyBatis - 一对一模型 SqlMapConfig 与 Mapper 详细讲解测试
java·开发语言·数据仓库·sql·mybatis·springboot·springcloud
转世成为计算机大神7 小时前
易考八股文之Java中的设计模式?
java·开发语言·设计模式
qq_327342737 小时前
Java实现离线身份证号码OCR识别
java·开发语言