Quick Start Guide — SDKMAN

Dehami Koswatte
3 min readSep 14, 2021
SDKMAN Official Site Logo

SDKMAN is a tool for managing parallel versions of Software Development Kits (SDKs) for most Unix-based systems according to its official website. It is a life-saver since you don’t have to manage versions manually. This article will guide you on how to install this tool and use it effectively. Without further ado, let’s move to the installation process.

Installation

Installation Process

The installation process is straightforward, and it requires only a few terminal commands. You need to run the following commands sequentially.

curl -s "https://get.sdkman.io" | bashsource "$HOME/.sdkman/bin/sdkman-init.sh"

After installing SDKMAN, you can check your installation through the following command, and it will show the version of the SDKMAN installed.

sdk version

That’s it for the installation! Next, let’s look at how to use SDKMAN efficiently.

Usage

If the installation is cool, the usage will be exponential that. The usages range from install SDKs to managing SDKs. The following section will guide you on the most important commands which you will use daily. For demonstration purposes, I will use Java as the SDK.

Installing an SDK

To install any SDK of a specific version, you can execute the following terminal commands.

  • First, check whether that SDK is available through SDKMAN by visiting the SDKs section of the official website or by executing the following command.
sdk list
  • Remember that you might want to press q to quit from the list.
  • If it exists, then enter the following command stricture to list all the versions of that SDK.
sdk list <SDK_NAME>
sdk list java
  • You will get an output like the picture attached below. You can see that I have already installed java 8 and java 11 through the Java.net vendor. In addition to that, the currently set java version is shown as >>>.
sdk list java command output
  • To install a new version, you use the following command structure. An example is also provided.
sdk install <SDK_NAME> <SDK_IDENTIFIER>
sdk install java 8.0.292-open
sdk install java 8.0.292-open command output

Setting the Default SDK

  • If the installation is the first version of that SDK, then it will be set as the default SDK. If you have multiple versions of that SDK, you can set the default version by using the following command structure.
sdk default <SDK_NAME> <SDK_IDENTIFIER>
sdk default java 11.0.12-open
sdk default java 11.0.12-open command output

Using an SDK Temporarily in a Terminal

  • To use an SDK temporarily in a terminal, you can use the following command structure.
sdk use <SDK_NAME> <SDK_IDENTIFIER>
sdk use java 8.0.302-open

The above-mentioned commands are the ones I use daily, and I hope they will be useful for you too!

Updating the SDKMAN

Updating the SDKMAN is simple, and you just need to type the following command. Since my SDKMAN is updated it says “No new candidates”.

sdk update
sdk update command output

That’s it for today, my friends. I hope this QSG is useful for your daily work!

--

--

Dehami Koswatte

Undergraduate at University of Westminster, Former Trainee Software Engineer @wso2