LinuxCommandLibrary

sdk

Manage software development kits (SDKs)

TLDR

Install an SDK version

$ sdk install [sdk_name] [sdk_version]
copy

Use a specific SDK version for the current terminal session
$ sdk use [sdk_name] [sdk_version]
copy

Show the stable version of any available SDK
$ sdk current [sdk_name]
copy

Show the stable versions of all installed SDKs
$ sdk current
copy

List all available SDKs
$ sdk list
copy

List all versions of an SDK
$ sdk list [sdk_name]
copy

Upgrade an SDK to the latest stable version
$ sdk upgrade [sdk_name]
copy

Uninstall a specific SDK version
$ sdk rm [sdk_name] [sdk_version]
copy

SYNOPSIS

sdk command [candidate] [version] [options]

Examples:
sdk list java
sdk install java 17.0.6-tem
sdk use java 17.0.6-tem
sdk default java 17.0.6-tem
sdk current
sdk version
sdk update
sdk selfupdate
sdk help

PARAMETERS

list [candidate]
    Lists all available SDKs or versions for a specific candidate (e.g., 'java', 'gradle').

install [version]
    Installs a specified version of a given candidate. If version is omitted, the latest stable version is installed.

uninstall
    Removes a specific installed version of a candidate.

use
    Temporarily sets the specified version of the candidate for the current shell session. This change is not persistent across new terminals.

default
    Permanently sets the specified version of the candidate as the default for all new shell sessions.

current [candidate]
    Displays the currently active SDKs or the specific version of a given candidate that is in use.

version
    Shows the installed SDKMAN! client version.

update
    Refreshes the local list of available SDKs and versions from the SDKMAN! remote server.

selfupdate
    Updates the SDKMAN! client itself to the latest available version.

help [command]
    Displays general help or detailed usage information for a specific command.

DESCRIPTION

The sdk command, specifically referring to SDKMAN! (Software Development Kit Manager), is a powerful command-line tool used to install, manage, and switch between multiple versions of various Software Development Kits (SDKs) and tools on Unix-like operating systems. It is widely used by developers to handle different versions of Java, Groovy, Scala, Kotlin, Maven, Gradle, and other related technologies. SDKMAN! simplifies the process of setting up development environments, allowing users to easily switch SDK versions per project or terminal session, ensuring compatibility and reducing setup complexities. It downloads SDKs from official sources or mirrors, manages their installation directories, and integrates seamlessly with the user's shell environment.

CAVEATS

The sdk command is not a standard, built-in Linux utility. It refers to SDKMAN!, which must be installed separately by the user. Its functionality relies heavily on network connectivity to download SDKs and updates. While versatile, it primarily focuses on JVM-based SDKs and related tools, though it supports a growing list of non-JVM candidates. Proper shell integration (sourcing the initialization script) is crucial for its PATH management and command availability.

SHELL INTEGRATION

For SDKMAN! to function correctly, its initialization script must be sourced in the user's shell profile (e.g., .bashrc, .zshrc). This script modifies the PATH environment variable, enables command auto-completion, and sets up helper functions, allowing users to execute sdk commands directly and manage SDK versions seamlessly within their terminal sessions.

OFFLINE MODE

Once an SDK version is installed, SDKMAN! can manage and switch to it even without an active internet connection. This allows developers to continue working on projects in environments with limited or no network access, provided the necessary SDKs have been pre-downloaded.

HISTORY

SDKMAN! originated as GVM (Groovy enVironment Manager) in 2013, initially designed to manage Groovy versions. As its capabilities expanded to include other JVM languages and tools, it was rebranded to SDKMAN! in 2015 to better reflect its broader scope. Since then, it has evolved into a widely adopted tool for managing a diverse range of SDKs, constantly adding support for new candidates and improving its features.

SEE ALSO

nvm(1), rvm(1), pyenv(1), asdf(1)

Copied to clipboard