LinuxCommandLibrary

sdk

Manage parallel SDK versions for JVM languages

TLDR

List all available candidates (Java, Scala, Kotlin, etc.)

$ sdk list
copy
List available versions of a candidate
$ sdk list java
copy
Install the latest stable version of a candidate
$ sdk install java
copy
Install a specific version
$ sdk install java [21.0.4-tem]
copy
Switch to a version for the current shell session
$ sdk use java [17.0.12-tem]
copy
Set a version as default for all shells
$ sdk default java [21.0.4-tem]
copy
Show currently active versions
$ sdk current
copy
Upgrade outdated candidates
$ sdk upgrade
copy

SYNOPSIS

sdk command [candidate] [version]

DESCRIPTION

SDKMAN (Software Development Kit Manager) is a tool for managing parallel versions of multiple SDKs on Unix-based systems. It simplifies installing, switching, and removing development kits for the JVM ecosystem.
Supported candidates include Java (multiple distributions like Temurin, Zulu, GraalVM), Scala, Kotlin, Groovy, Maven, Gradle, Ant, sbt, Spring Boot, Spark, and many more. SDKMAN automatically manages JAVA_HOME and PATH environment variables.
Project-specific versions can be configured using .sdkmanrc files. With sdkman_auto_env=true in the config, SDKMAN automatically switches versions when entering a project directory.

CONFIGURATION

~/.sdkman/etc/config

SDKMAN configuration file controlling auto-answer, auto-env, color, and other settings.
.sdkmanrc
Per-project file specifying required SDK versions. SDKMAN automatically switches versions when entering the directory if sdkman_auto_env=true is set.
SDKMAN_DIR
Environment variable overriding the default SDKMAN installation directory (~/.sdkman).

COMMANDS

install candidate [version]

Install a candidate version; latest stable if version omitted
uninstall candidate version
Remove an installed version
list [candidate]
List available candidates or versions of a specific candidate
use candidate version
Switch version for current terminal session only
default candidate version
Set version as default for all future shells
current [candidate]
Show active version of a candidate or all candidates
upgrade [candidate]
Upgrade outdated versions
version
Display SDKMAN version information
home candidate version
Return absolute installation path for a version
env [init|install|clear]
Manage project-specific .sdkmanrc configuration
offline [enable|disable]
Toggle offline mode
selfupdate [force]
Update SDKMAN itself
update
Refresh candidate metadata cache
flush [tmp|broadcast|archives|version]
Clear local cache and state
config
Open SDKMAN configuration file

CAVEATS

SDKMAN requires curl, zip, and unzip to be installed. It modifies shell configuration files during installation. The use command only affects the current shell; use default for persistent changes across sessions.

HISTORY

SDKMAN was originally created as GVM (Groovy enVironment Manager) by Marco Vermeulen around 2012. It was later renamed to SDKMAN to reflect its broader support for multiple SDK candidates beyond Groovy. The tool draws inspiration from version managers like RVM (Ruby), nvm (Node.js), and pyenv (Python).

SEE ALSO

java(1), javac(1), gradle(1), mvn(1), sbt(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community