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

相关推荐
XiaoLeisj31 分钟前
【JavaEE初阶 — 多线程】单例模式 & 指令重排序问题
java·开发语言·java-ee
paopaokaka_luck32 分钟前
【360】基于springboot的志愿服务管理系统
java·spring boot·后端·spring·毕业设计
dayouziei32 分钟前
java的类加载机制的学习
java·学习
Yaml42 小时前
Spring Boot 与 Vue 共筑二手书籍交易卓越平台
java·spring boot·后端·mysql·spring·vue·二手书籍
小小小妮子~3 小时前
Spring Boot详解:从入门到精通
java·spring boot·后端
hong1616883 小时前
Spring Boot中实现多数据源连接和切换的方案
java·spring boot·后端
aloha_7893 小时前
从零记录搭建一个干净的mybatis环境
java·笔记·spring·spring cloud·maven·mybatis·springboot
记录成长java4 小时前
ServletContext,Cookie,HttpSession的使用
java·开发语言·servlet
睡觉谁叫~~~4 小时前
一文解秘Rust如何与Java互操作
java·开发语言·后端·rust
程序媛小果4 小时前
基于java+SpringBoot+Vue的旅游管理系统设计与实现
java·vue.js·spring boot