Install SDKMAN! - lightblueseas/linuxstuff GitHub Wiki

Installation of package manager SDKMAN!

Precondition is that you have curl and zip installed on your system.

You have to install curl so follow the instruction from here

For install curl on your system run following command:

sudo apt install zip

Now you are ready to install the package manager SDKMAN!

For ubuntu you can install it with the following command:

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

when the installation process has finished you can check the installation with the following command:

sdk version

if nothing shows open a new shell console and if still nothing shows execute the following command:

source "~/.sdkman/bin/sdkman-init.sh"

or open a new one and try again.

sdk version

If all went well, the current version should be displayed. Something like:

script: 5.18.2
native: 0.4.6

For detailed information on how to install SDKMAN! see the official site.

Install Specific Java Version

For show a list of all provided java versions execute the following command:

sdk list java

This will list all java versions. Copy from the column 'Identifier' the value, we will use for our example the value '21.0.4-tem'. The shell command would look something like the following command:

sdk install java 21.0.4-tem

A question will follow if you want to set as the default jdk version, select 'n' if you do not want to.