The Software Development Kit Manager
다양한 버전의 jdk, sdk를 설치하고 사용할 때 사용하는데...
필자는 주로 java, maven, gradle 등을 설치할 때 사용한다..
설치는 간단하다.
$ curl -s "https://get.sdkman.io" | bash
설치후에는 SDKMAN을 사용하기 위해서는 아래 명령을 사용하거나, 새로운 terminal을 연다.
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
version 확인
$ sdk verison
SDKMAN 5.16.0
아래는 backup 하고 지우기 인데..
tar zcvf ~/sdkman-backup_$(date +%F-%kh%M).tar.gz -C ~/ .sdkman
$ rm -rf ~/.sdkman
귀찮으면 그냥 .sdkman만 지우면 된다.
$ rm -rf ~/.sdkman
사용법
$ sdk <subcommand> [candidate] [version]
Example
$ sdk help
$ sdk help list
$ sdk list gradle
$ sdk install gradle
$ sdk install gradle [version]
$ sdk default gradle [version]
$ sdk uninstall gradle [version]
설치할 수 있는 jdk list 확인
$ sdk list java
================================================================================
Available Java Versions for Linux 64bit
================================================================================
Vendor | Use | Version | Dist | Status | Identifier
--------------------------------------------------------------------------------
Corretto | | 19.0.1 | amzn | | 19.0.1-amzn
| | 17.0.5 | amzn | | 17.0.5-amzn
| | 11.0.17 | amzn | | 11.0.17-amzn
| >>> | 11.0.16 | amzn | local only | 11.0.16-amzn
| | 8.0.352 | amzn | | 8.0.352-amzn
Dragonwell | | 17.0.5 | albba | | 17.0.5-albba
| | 17.0.4 | albba | | 17.0.4-albba
| | 11.0.17 | albba | | 11.0.17-albba
| | 11.0.16 | albba | | 11.0.16-albba
...
생략
...
JDK install
$ sdk install java x.y.z-amzn
$ sdk install java x.y.z-oracle
$ sdk install java x.y.z-ms
...
OpenJDK 11.0.6을 설치 한다고 하면..
$ sdk install java 11.0.6-open
java version 확인
$ java --version
openjdk 11.0.16 2022-07-19 LTS
OpenJDK Runtime Environment Corretto-11.0.16.8.1 (build 11.0.16+8-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.16.8.1 (build 11.0.16+8-LTS, mixed mode)
maven list 확인
$ sdk list maven
================================================================================
Available Maven Versions
================================================================================
> * 3.8.6 3.3.3
3.8.5 3.3.1
3.8.4 3.2.5
3.8.3 3.2.3
3.8.2 3.2.2
3.8.1 3.2.1
3.6.3 3.1.1
3.6.2 3.1.0
3.6.1 3.0.5
3.6.0 3.0.4
3.5.4
3.5.3
3.5.2
3.5.0
3.3.9
================================================================================
+ - local version
* - installed
> - currently in use
================================================================================
최신 maven 설치
$ sdk install maven
특정 version 설치
$ sdk install maven 3.8.6
default version 변경
$ sdk default maven 3.6.3
간단히 요약하면..
$ sdk list gradle
$ sdk install gradle
$ sdk install gradle [version]
$ sdk default gradle [version]