How to install SDKMAN on Linux

Endrit Qerreti

Endrit Qerreti

In this tutorial, you will learn how to install SDKMAN on Linux.

SDKMAN is a tool that lets you manage your Software Development Kit with no hassle.

SDKMAN supports Linux, which means you can install it and use it on any Linux distro you want. It also supports Windows and MacOS.

SDKMAN is written in rust, and it is lightweight, so you should be able to use SDKMAN in any machine.

Installing SDKMAN on Linux

Installing SDKMAN on Linux is simple, and it can be done by using the official SDKMAN installer.

In this tutorial, we'll be using Ubuntu 22.04, and we'll be installing SDKMAN via the official installer.

Step 1 - Update your system

Depending the Linux distro that you want to install SDKMAN, make sure to update your system first.

We are using Ubuntu 22.04 for this tutorial, so we need to update our system before we install SDKMAN.

sudo apt update && apt upgrade -y

Step 2 - Install SDKMAN dependencies

In order to use SDKMAN, you must have curl, zip and unzip installed in your system.

If you are unsure if these packages are installed in your system, you can easily install them by running the command below.

sudo apt install curl zip unzip

Step 3 - Install SDKMAN

After updating and installing the required dependencies for SDKMAN, proceed to download the SDKMAN'S official installer, and install SDKMAN.

To do so, simply run the command below.

curl -s "https://get.sdkman.io" | bash

Once SDKMAN has been installed, you will see a similar output.

Next, add SDKMAN to the PATH.

source "$HOME/.sdkman/bin/sdkman-init.sh"

Step 4 - Verify SDKMAN Installation

Next, check SDKMAN version to verify that SDKMAN was installed correctly.

To check SDKMAN version, simply run the command below.

sdkman --version

Step 5 - Use SDKMAN

After verifying that SDKMAN was installed correctly, you should be able to use SDKMAN in your system.

sdk

Install SDK

To install a SDK via SDKMAN is very simple. And it can be done by using the install command.

For example, to install java, you can do so by running the command below.

sdk install java

Upgrade SDK

To upgrade SDK via SDKMAN, you need to use the upgrade command.

For example, to upgrade java run the following.

sdk upgrade java

Uninstall SDK

If you want to uninstall a SDK, then simply use the uninstall command.

For example, to uninstall java SDK, run the command below.

sdk uninstall java

Update SDKMAN

To check for new a version of SDKMAN, and install if availalbe, then you need to use the update command.

sdk update

Uninstall SDKMAN on Linux

We installed SDKMAN via the official installer in this tutorial, so to uninstall SDKMAN on Linux, all you need to do is remove the directory where SDKMAN was installed.

sudo rm -rf ~/.sdkman

Conclusion

In this tutorial, you learned how to install and uninstall SDKMAN in Linux.

In this tutorial, we used Ubuntu 22.04. However, you can install SDKMAN in any Linux distro by following this tutorial.