sdkman

2024-05-20

软件及插件

读书仅仅是向大脑提供知识原料,只有思考才能把所学的知识变成我们自己的东西。——洛克

https://sdkman.io/

可以用 sdkman 管理、下载、切换 java 版本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
Last login: Tue May 14 21:03:08 on ttys000

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
Github-Id-VampireAchao:blog achao$ cd
Github-Id-VampireAchao:~ achao$ curl -s "https://get.sdkman.io" | bash

-+syyyyyyys:
`/yho:` -yd.
`/yh/` +m.
.oho. hy .`
.sh/` :N` `-/o` `+dyyo:.
.yh:` `M- `-/osysoym :hs` `-+sys: hhyssssssssy+
.sh:` `N: ms/-`` yy.yh- -hy. `.N-````````+N.
`od/` `N- -/oM- ddd+` `sd: hNNm -N:
:do` .M. dMMM- `ms. /d+` `NMMs `do
.yy- :N` ```mMMM. - -hy. /MMM: yh
`+d+` `:/oo/` `-/osyh/ossssssdNMM` .sh: yMMN` /m.
-dh- :ymNMMMMy `-/shmNm-`:N/-.`` `.sN /N- `NMMy .m/
`oNs` -hysosmMMMMydmNmds+-.:ohm : sd` :MMM/ yy
.hN+ /d: -MMMmhs/-.` .MMMh .ss+- `yy` sMMN` :N.
:mN/ `N/ `o/-` :MMMo +MMMN- .` `ds mMMh do
/NN/ `N+....--:/+oooosooo+:sMMM: hMMMM: `my .m+ -MMM+ :N.
/NMo -+ooooo+/:-....`...:+hNMN. `NMMMd` .MM/ -m: oMMN. hs
-NMd` :mm -MMMm- .s/ -MMm. /m- mMMd -N.
`mMM/ .- /MMh. -dMo -MMMy od. .MMMs..---yh
+MMM. sNo`.sNMM+ :MMMM/ sh`+MMMNmNm+++-
mMMM- /--ohmMMM+ :MMMMm. `hyymmmdddo
MMMMh. ```` `-+yy/`yMMM/ :MMMMMy -sm:.``..-:-.`
dMMMMmo-.``````..-:/osyhddddho. `+shdh+. hMMM: :MmMMMM/ ./yy/` `:sys+/+sh/
.dMMMMMMmdddddmmNMMMNNNNNMMMMMs sNdo- dMMM- `-/yd/MMMMm-:sy+. :hs- /N`
`/ymNNNNNNNmmdys+/::----/dMMm: +m- mMMM+ohmo/.` sMMMMdo- .om: `sh
`.-----+/.` `.-+hh/` `od. NMMNmds/ `mmy:` +mMy `:yy.
/moyso+//+ossso:. .yy` `dy+:` .. :MMMN+---/oys:
/+m: `.-:::-` /d+ +MMMMMMMNh:`
+MN/ -yh. `+hddhy+.
/MM+ .sh:
:NMo -sh/
-NMs `/yy:
.NMy `:sh+.
`mMm` ./yds-
`dMMMmyo:-.````.-:oymNy:`
+NMMMMMMMMMMMMMMMMms:`
-+shmNMMMNmdy+:`


Now attempting installation...


Looking for a previous installation of SDKMAN...
Looking for unzip...
Looking for zip...
Looking for curl...
Looking for sed...
Installing SDKMAN scripts...
Create distribution directories...
Getting available candidates...
Prime platform file...
Prime the config file...
Installing script cli archive...
* Downloading...
######################################################################## 100.0%
* Checking archive integrity...
* Extracting archive...
* Copying archive contents...
* Cleaning up...

Installing script cli archive...
* Downloading...
######################################################################## 100.0%
* Checking archive integrity...
* Extracting archive...
* Copying archive contents...
* Cleaning up...

Set version to 5.18.2 ...
Set native version to 0.4.6 ...
Attempt update of login bash profile on OSX...
Added sdkman init snippet to /Users/achao/.bash_profile
Attempt update of zsh profile...
Updated existing /Users/achao/.zshrc



All done!


You are subscribed to the STABLE channel.

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

source "/Users/achao/.sdkman/bin/sdkman-init.sh"

Then issue the following command:

sdk help

Enjoy!!!
Github-Id-VampireAchao:~ achao$ source "$HOME/.sdkman/bin/sdkman-init.sh"
Github-Id-VampireAchao:~ achao$ sdk version

SDKMAN!
script: 5.18.2
native: 0.4.6

Github-Id-VampireAchao:~ achao$ sdk install java 11.0.22-open

Stop! java 11.0.22-open is not available. Possible causes:
* 11.0.22-open is an invalid version
* java binaries are incompatible with your platform
* java has not been released yet

Tip: see all available versions for your platform:

$ sdk list java
Github-Id-VampireAchao:~ achao$ sdk list java
Github-Id-VampireAchao:~ achao$ sdk list java
Github-Id-VampireAchao:~ achao$
Github-Id-VampireAchao:~ achao$ sdk list java
Github-Id-VampireAchao:~ achao$ sdk install java 11.0.22-amzn

Downloading: java 11.0.22-amzn

In progress...

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

Repackaging Java 11.0.22-amzn...

Done repackaging...
Cleaning up residual files...

Installing: java 11.0.22-amzn
Done installing!


Setting java 11.0.22-amzn as default.
Github-Id-VampireAchao:~ achao$ sdk use java 11

Stop! Candidate version is not installed.

Tip: Run the following to install this version

$ sdk install java 11
Github-Id-VampireAchao:~ achao$ sdk use java 11.0.22-amzn

Using java version 11.0.22-amzn in this shell.
Github-Id-VampireAchao:~ achao$ java -version
openjdk version "11.0.22" 2024-01-16 LTS
OpenJDK Runtime Environment Corretto-11.0.22.7.1 (build 11.0.22+7-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.22.7.1 (build 11.0.22+7-LTS, mixed mode)
Github-Id-VampireAchao:~ achao$ sdk current java

Using java version 11.0.22-amzn
Github-Id-VampireAchao:~ achao$ sdk list java
Github-Id-VampireAchao:~ achao$
Github-Id-VampireAchao:~ achao$

这里的 sdkmanlist

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
GithubIireAchao:~ achao$ sdk list java

================================================================================
Available Java Versions for macOS ARM 64bit
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
Corretto | | 22.0.2 | amzn | | 22.0.2-amzn
| | 21.0.4 | amzn | | 21.0.4-amzn
| >>> | 17.0.12 | amzn | installed | 17.0.12-amzn
| | 11.0.24 | amzn | | 11.0.24-amzn
| | 11.0.22 | amzn | local only | 11.0.22-amzn
| | 8.0.422 | amzn | | 8.0.422-amzn

| | 8.0.412 | amzn | local only | 8.0.412-amzn
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 | | 22.0.2 | graalce | | 22.0.2-graalce
| | 21.0.2 | graalce | | 21.0.2-graalce
| | 17.0.9 | graalce | | 17.0.9-graalce
GraalVM Oracle| | 24.ea.9 | graal | | 24.ea.9-graal
| | 24.ea.8 | graal | | 24.ea.8-graal
| | 24.ea.7 | graal | | 24.ea.7-graal
| | 23.ea.24 | graal | | 23.ea.24-graal
| | 23.ea.23 | graal | | 23.ea.23-graal
| | 23.ea.22 | graal | | 23.ea.22-graal
| | 23.ea.21 | graal | | 23.ea.21-graal
| | 22.0.2 | graal | | 22.0.2-graal
| | 21.0.4 | graal | | 21.0.4-graal
| | 17.0.12 | graal | | 17.0.12-graal
Java.net | | 24.ea.13 | open | | 24.ea.13-open
| | 24.ea.12 | open | | 24.ea.12-open
| | 24.ea.11 | open | | 24.ea.11-open
| | 24.ea.10 | open | | 24.ea.10-open
| | 24.ea.9 | open | | 24.ea.9-open
| | 23.ea.29 | open | | 23.ea.29-open
| | 22.0.1 | open | | 22.0.1-open
| | 21.0.2 | open | | 21.0.2-open
JetBrains | | 21.0.4 | jbr | | 21.0.4-jbr
| | 21.0.3 | jbr | | 21.0.3-jbr
| | 17.0.12 | jbr | | 17.0.12-jbr
| | 17.0.11 | jbr | | 17.0.11-jbr
| | 11.0.14.1 | jbr | | 11.0.14.1-jbr
Liberica | | 22.0.2.fx | librca | | 22.0.2.fx-librca
| | 22.0.2 | librca | | 22.0.2-librca
| | 21.0.4.fx | librca | | 21.0.4.fx-librca
| | 21.0.4 | librca | | 21.0.4-librca
| | 17.0.12.fx | librca | | 17.0.12.fx-librca
| | 17.0.12 | librca | | 17.0.12-librca
| | 11.0.24.fx | librca | | 11.0.24.fx-librca
| | 11.0.24 | librca | | 11.0.24-librca
| | 8.0.422.fx | librca | | 8.0.422.fx-librca
| | 8.0.422 | librca | | 8.0.422-librca
Liberica NIK | | 24.0.2.r22 | nik | | 24.0.2.r22-nik
| | 23.1.4.r21 | nik | | 23.1.4.r21-nik
| | 23.0.5.r17 | nik | | 23.0.5.r17-nik
| | 22.3.5.r17 | nik | | 22.3.5.r17-nik
| | 22.3.5.r11 | nik | | 22.3.5.r11-nik
Mandrel | | 24.0.2.r22 | mandrel | | 24.0.2.r22-mandrel
| | 23.1.4.r21 | mandrel | | 23.1.4.r21-mandrel
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
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
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
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
================================================================================
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
================================================================================