当前位置 : 首页 » 文章分类 :  开发  »  SDKMAN

SDKMAN

SDKMAN
https://sdkman.io/


命令

sdk ls 搜索软件

列出可用的sdk版本,例如查看jdk的版本:sdk ls java

sdk current 查看已安装软件

$ sdk current

Using:

java: 21.0.1-oracle
maven: 3.9.6

sdk install 安装软件

sdk rm 卸载软件

sdk version 查看sdkman版本

sdk help 帮助


Mac 使用 sdkman 管理多 jdk 版本

1、安装 sdkman
https://github.com/sdkman/homebrew-tap
brew tap sdkman/tap
brew install sdkman-cli

2、sdk list java 列出可用 jdk 版本


CentOS7 sdkman 安装jdk21

安装 zip unzip

1、安装 zip unzip
yum install zip unzip

必须先安装 zip
yum install zip unzip
否则安装 sdkman 报错:
Please install zip on your system using your favourite package manager.

安装 sdkman

2、安装 sdkman
curl -s “https://get.sdkman.io" | bash

Set version to 5.18.2 ...
Set native version to 0.4.3 ...
Attempt update of interactive bash profile on regular UNIX...
Added sdkman init snippet to /home/centos/.bashrc
Attempt update of zsh profile...
Updated existing /home/centos/.zshrc

All done!

You are subscribed to the STABLE channel.

Please open a new terminal, or run the following in the existing one:

    source "/home/centos/.sdkman/bin/sdkman-init.sh"

Then issue the following command:

    sdk help

sdk ls java 查看可安装的 java 版本

3、查看 java 版本
sdk list java|cat

$ sdk list java|cat
================================================================================
Available Java Versions for Linux 64bit
================================================================================
 Vendor        | Use | Version      | Dist    | Status     | Identifier
--------------------------------------------------------------------------------
 Corretto      |     | 21.0.1       | amzn    |            | 21.0.1-amzn
               |     | 17.0.9       | amzn    |            | 17.0.9-amzn
               |     | 11.0.21      | amzn    |            | 11.0.21-amzn
               |     | 8.0.392      | amzn    |            | 8.0.392-amzn
 Dragonwell    |     | 17.0.9       | albba   |            | 17.0.9-albba
               |     | 11.0.20      | albba   |            | 11.0.20-albba
               |     | 8.0.382      | albba   |            | 8.0.382-albba
 Gluon         |     | 22.1.0.1.r17 | gln     |            | 22.1.0.1.r17-gln
               |     | 22.1.0.1.r11 | gln     |            | 22.1.0.1.r11-gln
 GraalVM CE    |     | 21.0.1       | graalce |            | 21.0.1-graalce
               |     | 17.0.9       | graalce |            | 17.0.9-graalce
 GraalVM Oracle|     | 21.0.1       | graal   |            | 21.0.1-graal
               |     | 17.0.9       | graal   |            | 17.0.9-graal
 Java.net      |     | 22.ea.26     | open    |            | 22.ea.26-open
               |     | 21.ea.35     | open    |            | 21.ea.35-open
 JetBrains     |     | 17.0.9       | jbr     |            | 17.0.9-jbr
               |     | 11.0.14.1    | jbr     |            | 11.0.14.1-jbr
 Liberica      |     | 21.0.1.crac  | librca  |            | 21.0.1.crac-librca
               |     | 21.0.1.fx    | librca  |            | 21.0.1.fx-librca
               |     | 21.0.1       | librca  |            | 21.0.1-librca
               |     | 17.0.9.crac  | librca  |            | 17.0.9.crac-librca
               |     | 17.0.9.fx    | librca  |            | 17.0.9.fx-librca
               |     | 17.0.9       | librca  |            | 17.0.9-librca
               |     | 11.0.21.fx   | librca  |            | 11.0.21.fx-librca
               |     | 11.0.21      | librca  |            | 11.0.21-librca
               |     | 8.0.392.fx   | librca  |            | 8.0.392.fx-librca
               |     | 8.0.392      | librca  |            | 8.0.392-librca
 Liberica NIK  |     | 23.1.1.r21   | nik     |            | 23.1.1.r21-nik
               |     | 22.3.4.r17   | nik     |            | 22.3.4.r17-nik
               |     | 22.3.4.r11   | nik     |            | 22.3.4.r11-nik
 Mandrel       |     | 23.1.1.r21   | mandrel |            | 23.1.1.r21-mandrel
 Microsoft     |     | 21.0.1       | ms      |            | 21.0.1-ms
               |     | 17.0.9       | ms      |            | 17.0.9-ms
               |     | 11.0.21      | ms      |            | 11.0.21-ms
 Oracle        |     | 21.0.1       | oracle  |            | 21.0.1-oracle
               |     | 17.0.9       | oracle  |            | 17.0.9-oracle
 SapMachine    |     | 21.0.1       | sapmchn |            | 21.0.1-sapmchn
               |     | 17.0.9       | sapmchn |            | 17.0.9-sapmchn
               |     | 11.0.21      | sapmchn |            | 11.0.21-sapmchn
 Semeru        |     | 17.0.9       | sem     |            | 17.0.9-sem
               |     | 11.0.21      | sem     |            | 11.0.21-sem
               |     | 8.0.392      | sem     |            | 8.0.392-sem
 Temurin       |     | 21.0.1       | tem     |            | 21.0.1-tem
               |     | 17.0.9       | tem     |            | 17.0.9-tem
               |     | 11.0.21      | tem     |            | 11.0.21-tem
               |     | 8.0.392      | tem     |            | 8.0.392-tem
 Tencent       |     | 17.0.9       | kona    |            | 17.0.9-kona
               |     | 11.0.21      | kona    |            | 11.0.21-kona
               |     | 8.0.392      | kona    |            | 8.0.392-kona
 Trava         |     | 11.0.15      | trava   |            | 11.0.15-trava
               |     | 8.0.282      | trava   |            | 8.0.282-trava
 Unclassified|     | 22.3.3.r11   | grl     |            | 22.3.3.r11-grl
 Zulu          |     | 21.0.1       | zulu    |            | 21.0.1-zulu
               |     | 21.0.1.crac  | zulu    |            | 21.0.1.crac-zulu
               |     | 21.0.1.fx    | zulu    |            | 21.0.1.fx-zulu
               |     | 17.0.9       | zulu    |            | 17.0.9-zulu
               |     | 17.0.9.crac  | zulu    |            | 17.0.9.crac-zulu
               |     | 17.0.9.fx    | zulu    |            | 17.0.9.fx-zulu
               |     | 11.0.21      | zulu    |            | 11.0.21-zulu
               |     | 11.0.21.fx   | zulu    |            | 11.0.21.fx-zulu
               |     | 8.0.392      | zulu    |            | 8.0.392-zulu
               |     | 8.0.392.fx   | zulu    |            | 8.0.392.fx-zulu
               |     | 7.0.352      | zulu    |            | 7.0.352-zulu
               |     | 6.0.119      | zulu    |            | 6.0.119-zulu
================================================================================
Omit Identifier to install default version 21.0.1-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.1-tem
Hit Q to exit this list view
================================================================================

sdkman 安装 21.0.1-oracle

指定 Identifier 列里的值来安装指定版本
sdk install java 21.0.1-oracle

$ sdk install java 21.0.1-oracle

Downloading: java 21.0.1-oracle

In progress...

######################################################################## 100.0%

Repackaging Java 21.0.1-oracle...

Done repackaging...

Installing: java 21.0.1-oracle
Done installing!


Setting java 21.0.1-oracle as default.

验证 java 版本:

$ java -version
java version "21.0.1" 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode, sharing)

sdk ls maven 查看可安装的 maven 版本

sdk list maven|cat

$ sdk list maven|cat
================================================================================
Available Maven Versions
================================================================================
     4.0.0-alpha-8       3.8.4               3.2.5
     4.0.0-alpha-7       3.8.3               3.2.3
     4.0.0-alpha-5       3.8.2               3.2.2
     4.0.0-alpha-4       3.8.1               3.2.1
     3.9.6               3.6.3               3.1.1
     3.9.5               3.6.2               3.1.0
     3.9.4               3.6.1               3.0.5
     3.9.3               3.6.0               3.0.4
     3.9.2               3.5.4
     3.9.1               3.5.3
     3.9.0               3.5.2
     3.8.8               3.5.0
     3.8.7               3.3.9
     3.8.6               3.3.3
     3.8.5               3.3.1

================================================================================
+ - local version
* - installed
> - currently in use
================================================================================

sdkman 安装 maven 3.9.6

sdk install maven 3.9.6

$ sdk install maven 3.9.6

Downloading: maven 3.9.6

In progress...

######################################################################## 100.0%

Installing: maven 3.9.6
Done installing!


Setting maven 3.9.6 as default.

上一篇 Elasticsearch-索引

下一篇 LeetCode.058.Length of Last Word 最后一个单词的长度

阅读
评论
1.2k
阅读预计7分钟
创建日期 2023-12-08
修改日期 2023-12-08
类别
标签

页面信息

location:
protocol:
host:
hostname:
origin:
pathname:
href:
document:
referrer:
navigator:
platform:
userAgent:

评论