SDKMan: Difference between revisions
Jump to navigation
Jump to search
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{| | {| | ||
| valign='top'| | | valign='top'| | ||
< | <syntaxhighlight lang="bash"> | ||
curl -s "https://get.sdkman.io" | bash | curl -s "https://get.sdkman.io" | bash | ||
source "$HOME/.sdkman/bin/sdkman-init.sh" | source "$HOME/.sdkman/bin/sdkman-init.sh" | ||
</ | </syntaxhighlight> | ||
| valign='top'| | | valign='top'| | ||
< | <syntaxhighlight lang="bash"> | ||
cat ~/.bashrc | cat ~/.bashrc | ||
sdk version | sdk version | ||
</source> | </syntaxhighlight> | ||
| valign='top'| | |||
<syntaxhighlight lang="bash"> | |||
source ~/.profile | |||
source ~/.bashrc | |||
</syntaxhighlight> | |||
|- | |||
|colspan='3'| | |||
---- | |||
|- | |||
|colspan='3'| | |||
<syntaxhighlight lang="bash"> | |||
brew tap sdkman/tap | |||
brew install sdkman-cli | |||
cat <<-'ENV' | tee -a ${HOME}/.bashrc >/dev/null | |||
# add sdkman environment variable into the PATH | |||
export SDKMAN_DIR=$(brew --prefix sdkman-cli)/libexec | |||
[[ -s "${SDKMAN_DIR}/bin/sdkman-init.sh" ]] && source "${SDKMAN_DIR}/bin/sdkman-init.sh" | |||
ENV | |||
</syntaxhighlight> | |||
|} | |} | ||
Line 55: | Line 78: | ||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang='bash'> | ||
tee ./.sdkmanrc >/dev/null <<'EOF' | tee ./.sdkmanrc >/dev/null <<'EOF' | ||
# Enable auto-env through the sdkman_auto_env config | # Enable auto-env through the sdkman_auto_env config | ||
Line 61: | Line 84: | ||
java=21.0.2-tem | java=21.0.2-tem | ||
EOF | EOF | ||
</ | </syntaxhighlight> | ||
|} | |} | ||
Line 68: | Line 91: | ||
{| | {| | ||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang='bash'> | ||
sudo apt install openjdk-8-jdk | sudo apt install openjdk-8-jdk | ||
sudo apt install openjdk-11-jdk | sudo apt install openjdk-11-jdk | ||
sudo apt install openjdk-17-jdk | sudo apt install openjdk-17-jdk | ||
sudo apt install openjdk-21-jdk | sudo apt install openjdk-21-jdk | ||
</ | </syntaxhighlight> | ||
|valign='top'| | |valign='top' colspan='2'| | ||
< | <syntaxhighlight lang='bash'> | ||
sdk install java 8 /usr/lib/jvm/java-8-openjdk-$(dpkg --print-architecture) | sdk install java 8 /usr/lib/jvm/java-8-openjdk-$( dpkg --print-architecture) | ||
sdk install java 11 /usr/lib/jvm/java-11-openjdk-$(dpkg --print-architecture) | sdk install java 11 /usr/lib/jvm/java-11-openjdk-$(dpkg --print-architecture) | ||
sdk install java 17 /usr/lib/jvm/java-17-openjdk-$(dpkg --print-architecture) | sdk install java 17 /usr/lib/jvm/java-17-openjdk-$(dpkg --print-architecture) | ||
sdk install java 21 /usr/lib/jvm/java-21-openjdk-$(dpkg --print-architecture) | sdk install java 21 /usr/lib/jvm/java-21-openjdk-$(dpkg --print-architecture) | ||
</ | </syntaxhighlight> | ||
|- | |- | ||
|valign='top' colspan=' | |valign='top' colspan='3'| | ||
---- | ---- | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang='bash'> | ||
sdk use java 8 | sdk use java 8 | ||
sdk use java 11 | sdk use java 11 | ||
sdk use java 17 | sdk use java 17 | ||
sdk use java 21 | sdk use java 21 | ||
</ | </syntaxhighlight> | ||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
sdk home java 8 | |||
sdk home java 11 | |||
sdk home java 17 | |||
sdk home java 21 | |||
</syntaxhighlight> | |||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang='bash'> | ||
sdk uninstall java 8 | sdk uninstall java 8 | ||
sdk uninstall java 11 | sdk uninstall java 11 | ||
sdk uninstall java 17 | sdk uninstall java 17 | ||
sdk uninstall java 21 | sdk uninstall java 21 | ||
</ | </syntaxhighlight> | ||
|} | |} | ||
Line 108: | Line 139: | ||
{| | {| | ||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang="bash"> | ||
sdk install springboot | sdk install springboot | ||
sdk install quarkus | sdk install quarkus | ||
Line 116: | Line 147: | ||
sdk install maven | sdk install maven | ||
sdk install java | sdk install java | ||
</ | </syntaxhighlight> | ||
|valign='top'| | |valign='top'| | ||
Line 128: | Line 159: | ||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang="bash"> | ||
sdk upgrade springboot | sdk upgrade springboot | ||
sdk upgrade quarkus | sdk upgrade quarkus | ||
Line 136: | Line 167: | ||
sdk upgrade maven | sdk upgrade maven | ||
sdk upgrade java | sdk upgrade java | ||
</ | </syntaxhighlight> | ||
|} | |} | ||
Line 143: | Line 174: | ||
{| | {| | ||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang="bash"> | ||
sdk install java 23.1.2.r21-mandrel | sdk install java 23.1.2.r21-mandrel | ||
sdk install java 21.0.2-graalce | sdk install java 21.0.2-graalce | ||
sdk install java 21.0.2-graal | sdk install java 21.0.2-graal | ||
</ | </syntaxhighlight> | ||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang="bash"> | ||
sdk use java 23.1.2.r21-mandrel | sdk use java 23.1.2.r21-mandrel | ||
sdk use java 21.0.2-graalce | sdk use java 21.0.2-graalce | ||
sdk use java 21.0.2-graal | sdk use java 21.0.2-graal | ||
</ | </syntaxhighlight> | ||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang="bash"> | ||
sdk uninstall java 23.1.2.r21-mandrel | sdk uninstall java 23.1.2.r21-mandrel | ||
sdk uninstall java 21.0.2-graalce | sdk uninstall java 21.0.2-graalce | ||
sdk uninstall java 21.0.2-graal | sdk uninstall java 21.0.2-graal | ||
</ | </syntaxhighlight> | ||
|- | |- | ||
Line 168: | Line 199: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang="bash"> | ||
sdk list springboot | sdk list springboot | ||
sdk list quarkus | sdk list quarkus | ||
Line 176: | Line 207: | ||
sdk list maven | sdk list maven | ||
sdk list java | sdk list java | ||
</ | </syntaxhighlight> | ||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang="bash"> | ||
sdk offline disable | sdk offline disable | ||
sdk offline enable | sdk offline enable | ||
Line 187: | Line 218: | ||
sdk home java 11 | sdk home java 11 | ||
sdk home java 8 | sdk home java 8 | ||
</ | </syntaxhighlight> | ||
|valign='top'| | |valign='top'| | ||
< | <syntaxhighlight lang="bash"> | ||
sdk selfupdate force | sdk selfupdate force | ||
sdk selfupdate | sdk selfupdate | ||
Line 198: | Line 229: | ||
sdk help install | sdk help install | ||
sdk config | sdk config | ||
</ | </syntaxhighlight> | ||
|} | |} | ||
Line 205: | Line 236: | ||
{| | {| | ||
| valign="top" | | | valign="top" | | ||
* [https://build-native-java-apps.cc/introduction/installation/ | * [https://build-native-java-apps.cc/introduction/installation/ SDK » GraalVM » Installation] | ||
* [https://github.com/sdkman/sdkman-db-migrations | * [https://github.com/sdkman/sdkman-db-migrations SDK » Database Migrations] | ||
* [https://github.com/sdkman/sdkman-cli/issues/673 | * [https://github.com/sdkman/sdkman-cli/issues/673 SDK » Use System Artifact] | ||
* [https://springframework.guru/using-sdkman-for-your-development-environment/ | * [https://springframework.guru/using-sdkman-for-your-development-environment/ SDK » For Development] | ||
* [https://trello.com/b/mQLHVahc/sdkman-dev-board | * [https://github.com/sdkman/homebrew-tap SDK » Brew » Tap] | ||
* [https://sdkman.io/usage | * [https://trello.com/b/mQLHVahc/sdkman-dev-board SDK » Dev Board] | ||
* [https://sdkman.io/install | * [https://sdkman.io/usage SDK » Usage] | ||
* [https://sdkman.io/jdks | * [https://sdkman.io/install SDK » Install] | ||
* [https://sdkman.io/ | * [https://sdkman.io/jdks SDK » JDKs] | ||
* [https://sdkman.io/ SDK] | |||
| valign="top" | | | valign="top" | |
Latest revision as of 09:06, 8 July 2024
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
|
cat ~/.bashrc
sdk version
|
source ~/.profile
source ~/.bashrc
|
| ||
brew tap sdkman/tap
brew install sdkman-cli
cat <<-'ENV' | tee -a ${HOME}/.bashrc >/dev/null
# add sdkman environment variable into the PATH
export SDKMAN_DIR=$(brew --prefix sdkman-cli)/libexec
[[ -s "${SDKMAN_DIR}/bin/sdkman-init.sh" ]] && source "${SDKMAN_DIR}/bin/sdkman-init.sh"
ENV
|
Help
Usage: sdk <command> [candidate] [version] sdk offline <enable|disable> commands: install or i <candidate> [version] [local-path] uninstall or rm <candidate> <version> list or ls [candidate] use or u <candidate> <version> config default or d <candidate> [version] home or h <candidate> <version> env or e [init|install|clear] current or c [candidate] upgrade or ug [candidate] version or v help offline [enable|disable] selfupdate [force] update flush [tmp|metadata|version] |
sdk default java 23.1.2.r21-mandrel |
SDKMan RC
sdk env sdk env init sdk env clear sdk env install |
tee ./.sdkmanrc >/dev/null <<'EOF'
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=21.0.2-tem
EOF
|
Local Install
sudo apt install openjdk-8-jdk
sudo apt install openjdk-11-jdk
sudo apt install openjdk-17-jdk
sudo apt install openjdk-21-jdk
|
sdk install java 8 /usr/lib/jvm/java-8-openjdk-$( dpkg --print-architecture)
sdk install java 11 /usr/lib/jvm/java-11-openjdk-$(dpkg --print-architecture)
sdk install java 17 /usr/lib/jvm/java-17-openjdk-$(dpkg --print-architecture)
sdk install java 21 /usr/lib/jvm/java-21-openjdk-$(dpkg --print-architecture)
| |
| ||
sdk use java 8
sdk use java 11
sdk use java 17
sdk use java 21
|
sdk home java 8
sdk home java 11
sdk home java 17
sdk home java 21
|
sdk uninstall java 8
sdk uninstall java 11
sdk uninstall java 17
sdk uninstall java 21
|
Management
sdk install springboot
sdk install quarkus
sdk install groovy
sdk install gradle
sdk install jbang
sdk install maven
sdk install java
|
sdk install springboot {verion-number} sdk install quarkus {verion-number} sdk install groovy {verion-number} sdk install gradle {verion-number} sdk install jbang {verion-number} sdk install maven {verion-number} sdk install java {verion-number} |
sdk upgrade springboot
sdk upgrade quarkus
sdk upgrade groovy
sdk upgrade gradle
sdk upgrade jbang
sdk upgrade maven
sdk upgrade java
|
Playground
sdk install java 23.1.2.r21-mandrel
sdk install java 21.0.2-graalce
sdk install java 21.0.2-graal
|
sdk use java 23.1.2.r21-mandrel
sdk use java 21.0.2-graalce
sdk use java 21.0.2-graal
|
sdk uninstall java 23.1.2.r21-mandrel
sdk uninstall java 21.0.2-graalce
sdk uninstall java 21.0.2-graal
|
| ||
sdk list springboot
sdk list quarkus
sdk list groovy
sdk list gradle
sdk list jbang
sdk list maven
sdk list java
|
sdk offline disable
sdk offline enable
sdk home java 21
sdk home java 17
sdk home java 11
sdk home java 8
|
sdk selfupdate force
sdk selfupdate
sdk default java 8
sdk current java
sdk help install
sdk config
|
References
| ||