How to Install SDKMAN on Ubuntu 26.04, 24.04 and 22.04

Install SDKMAN on Ubuntu 26.04, 24.04, and 22.04 with the official installer. Covers Java, Maven, Gradle, Kotlin, updates, and removal.

PublishedAuthorJoshua JamesRead time7 minGuide typeUbuntu

JVM projects often pin different Java, Gradle, Maven, Kotlin, or Scala releases, and swapping those tools with APT can turn into system-wide cleanup work. When you install SDKMAN on Ubuntu Linux, each managed SDK stays under your user account in ~/.sdkman, so project-specific toolchains do not replace Ubuntu’s system packages.

The official SDKMAN installer works the same way on Ubuntu 26.04, 24.04, and 22.04. Ubuntu does not package sdkman for APT, and the visible Snap wrapper is unofficial, so the main path stays on the upstream Bash installer with first-use, update, troubleshooting, and removal steps aligned to that per-user layout.

Install SDKMAN on Ubuntu

Choose the SDKMAN Install Path on Ubuntu

Use the official installer for normal Ubuntu terminals. The other paths matter mostly because search results can confuse SDKMAN with Android’s sdkmanager, an unofficial Snap wrapper, or package-manager assumptions that do not install SDKMAN itself.

PathCurrent StatusBest Fit
Official installerSDKMAN installation docs provide the upstream installer for the current script and native CLI under ~/.sdkmanRecommended path for Bash and Zsh users on Ubuntu
Ubuntu APTUbuntu package metadata does not currently provide an sdkman package; sdkmanager is Android SDK tooling, not SDKMANDo not use APT for SDKMAN itself
Snap wrapperjsdkman on Snapcraft identifies itself as an unofficial distribution and currently trails the official installerOnly for users who deliberately want the community Snap wrapper
Homebrew/LinuxbrewNo SDKMAN formula is published under the expected sdkman or sdkman-cli namesUse the upstream installer instead of adding a separate prefix for SDKMAN
CI modeSame official installer with non-interactive parametersAutomation jobs where profile-file edits are unwanted

For most Ubuntu workstations, servers, and development VMs, use the official installer. It keeps SDKMAN’s own update and removal behavior consistent with upstream documentation.

Update Ubuntu and Install SDKMAN Prerequisites

Ubuntu already includes Bash, tar, find, and sed on normal installations. Add curl, certificate support, and archive tools so the SDKMAN installer can download and unpack its CLI files cleanly, especially on minimal server images.

sudo apt update

These commands use sudo for package installation. If your account cannot run administrative commands yet, configure sudo access first with the guide on how to add a new user to sudoers on Ubuntu.

sudo apt install curl zip unzip ca-certificates -y

If you want more detail on the download flags used by the installer command, the curl command in Linux reference explains how curl handles redirects, failures, and quiet output.

Run the Official SDKMAN Installer

SDKMAN’s documentation uses the installer at get.sdkman.io. The -fsSL flags keep the same upstream installer while making curl fail on HTTP errors, show real transfer errors, and follow redirects.

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

Relevant output includes the dependency checks, installed SDKMAN script version, installed native CLI version, and final completion message:

Looking for unzip...
Looking for zip...
Looking for tar...
Looking for find...
Looking for curl...
Looking for sed...
Set version to 5.23.0 ...
Set native version to 0.7.34 ...
All done!

Load SDKMAN into the current terminal session instead of closing your shell:

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

The installer adds the same initialization line to your Bash profile for future terminals. Zsh users can keep the same SDKMAN init line in ~/.zshrc; if you are switching shells first, see the guide to install Zsh on Ubuntu.

Verify SDKMAN on Ubuntu

Confirm that the shell can load the sdk command:

sdk version
SDKMAN!
script: 5.23.0
native: 0.7.34 (linux x86_64)

The script and native version numbers change as SDKMAN releases updates. The important result is that sdk version prints both lines without a command not found error.

Install SDKMAN in CI Mode on Ubuntu

Use CI mode only for automated environments where SDKMAN should avoid prompts and skip shell-profile edits. The ci=true parameter enables non-interactive behavior, and rcupdate=false keeps the installer from changing ~/.bashrc or ~/.zshrc.

curl -fsSL "https://get.sdkman.io?ci=true&rcupdate=false" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"

For normal interactive Ubuntu terminals, stay with the standard installer so new shells automatically load SDKMAN.

Getting Started with SDKMAN on Ubuntu

SDKMAN manages candidates, which are installable SDK families such as Java, Maven, Gradle, Kotlin, Scala, Spring Boot, Groovy, and many other JVM tools. The SDKMAN candidate list shows the current defaults, while the SDKMAN JDK page explains why Temurin is the default JDK distribution.

List Available SDKMAN Candidates

Use sdk list to see every candidate family, or list Java directly when choosing a JDK. Long lists open in a pager, so press q when you finish reading.

sdk list java

Relevant Java output begins with a platform-specific version table:

================================================================================
Available Java Versions for Linux 64bit
================================================================================
 Vendor        | Use | Version      | Dist    | Status     | Identifier
--------------------------------------------------------------------------------
 Corretto      |     | 26.0.1       | amzn    |            | 26.0.1-amzn
               |     | 25.0.3       | amzn    |            | 25.0.3-amzn
               |     | 21.0.11      | amzn    |            | 21.0.11-amzn

The Identifier column is what you use when installing a specific version, such as 21.0.11-amzn or another identifier from your current list.

Install a Java JDK with SDKMAN

Install the current default Java JDK when you do not need a pinned vendor or version. SDKMAN prompts to make the installed JDK the default for future shells; pressing Enter accepts that default.

sdk install java

Current SDKMAN catalogs can move as vendors publish new builds. Relevant output currently shows the default Java candidate resolving to Temurin 25:

Downloading: java 25.0.3-tem
Repackaging Java 25.0.3-tem...
Done repackaging...
Installing: java 25.0.3-tem
Done installing!
Setting java 25.0.3-tem as default.

Verify which JDK your shell is using:

sdk current java
java -version
Current default java version 25.0.3-tem
openjdk version "25.0.3" 2026-04-21 LTS
OpenJDK Runtime Environment Temurin-25.0.3+9 (build 25.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.3+9 (build 25.0.3+9-LTS, mixed mode, sharing)

If you want Ubuntu’s system-managed Java instead of a per-user SDKMAN JDK, use the package-managed guides to install OpenJDK 25 on Ubuntu or install OpenJDK 21 on Ubuntu.

Install Specific SDKMAN Versions

Use an identifier from sdk list java when a project needs a specific vendor or JDK line. Replace the example identifier with one shown in your current SDKMAN catalog.

sdk install java 21.0.11-tem

Switch only the current terminal with sdk use, or make a version the default for future terminals with sdk default:

sdk use java 21.0.11-tem
sdk default java 21.0.11-tem

That distinction matters when one project needs Java 21 while another project should keep the latest default Java selected by SDKMAN.

Install Maven, Gradle, and Kotlin with SDKMAN

After Java works, install common JVM build tools from the same SDKMAN workflow. These commands place the tools under ~/.sdkman/candidates and update the active shell through SDKMAN.

sdk install maven
sdk install gradle
sdk install kotlin

Check each tool from the same terminal session:

mvn -version | sed -n '1s/ (.*//p'
gradle --version | sed -n '/^Gradle /p'
kotlinc -version 2>&1
Apache Maven 3.9.15
Gradle 9.5.0
info: kotlinc-jvm 2.3.21 (JRE 25.0.3+9-LTS)

Your versions may be newer than this sample when SDKMAN updates its default candidates.

SDKMAN is useful when one user account owns the build-tool versions. If you prefer package-managed tooling instead, the Ubuntu guides for installing Apache Maven on Ubuntu and installing Kotlin on Ubuntu cover APT, Snap, Homebrew, and manual package paths where they fit.

Use Project-Specific SDKMAN Versions

For repositories that need their own toolchain versions, create an .sdkmanrc file in the project root. SDKMAN can read that file later and switch the current shell to the listed versions.

mkdir -p ~/sdkman-demo
cd ~/sdkman-demo
sdk env init
cat .sdkmanrc
.sdkmanrc created.
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=25.0.3-tem

When a repository already contains an .sdkmanrc file, install missing SDKs. SDKMAN also switches the current shell after the install check:

sdk env install
java 25.0.3-tem is already installed.

Using java version 25.0.3-tem in this shell.

Run sdk env later when the SDKs are already installed and you only need to switch the current shell:

sdk env
Using java version 25.0.3-tem in this shell.

Use sdk env clear when you leave the project and want to return to your default SDKMAN versions.

sdk env clear
Restored java version to 25.0.3-tem (default)

If you created the demo directory for this example, remove it after checking the project workflow:

cd "$HOME"
rm "$HOME/sdkman-demo/.sdkmanrc"
rmdir "$HOME/sdkman-demo"
test ! -e "$HOME/sdkman-demo" && echo "sdkman-demo removed"
sdkman-demo removed

Manage SDKMAN on Ubuntu

Update SDKMAN and Candidate Metadata

SDKMAN updates its own scripts separately from Ubuntu’s package manager. Use selfupdate for the SDKMAN CLI, then refresh the candidate catalog when SDKMAN reports stale metadata.

sdk selfupdate
sdk update

Installed SDKs are upgraded with SDKMAN as well:

sdk upgrade
sdk upgrade java

The broad sdk upgrade command checks every installed candidate, while sdk upgrade java limits the check to Java.

Remove a Single SDKMAN Candidate Version

Use sdk uninstall when you only want to remove one installed candidate version instead of deleting SDKMAN completely. Check the active version first, because SDKMAN refuses to remove a version that the current shell is using.

sdk current java
sdk uninstall java 21.0.11-tem
Current default java version 25.0.3-tem
removed java 21.0.11-tem.

Replace 21.0.11-tem with an installed identifier from sdk list java. If the version is active, switch to another installed Java version with sdk use or sdk default before uninstalling it.

Find SDKMAN Paths and Clear Local State

Use sdk home when a tool or editor needs an absolute SDK path. Use sdk flush when SDKMAN asks you to clear local archives or temporary metadata.

sdk home java 25.0.3-tem
sdk flush

For Java-specific environment-variable work outside SDKMAN, the Ubuntu Java environment path guide explains how JAVA_HOME behaves with system and project tooling.

Troubleshoot SDKMAN on Ubuntu

Fix sdk: command not found

The installer may have succeeded even if the current terminal has not loaded SDKMAN yet. Source the init script, then check whether your shell startup file contains the SDKMAN line.

source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk version
grep -F '.sdkman/bin/sdkman-init.sh' ~/.bashrc ~/.zshrc 2>/dev/null || true

If grep finds no startup-file entry, rerun the installer without rcupdate=false or add the source line to the startup file for your shell.

Fix Missing curl, zip, or unzip Errors

SDKMAN checks for required shell tools before installing. If the installer stops on a missing dependency, install the prerequisite set again and rerun the installer.

sudo apt update
sudo apt install curl zip unzip ca-certificates -y
curl -fsSL "https://get.sdkman.io" | bash

Fix Stale Candidate Lists or Network Warnings

SDKMAN needs network access for candidate lists, downloads, and health checks. Refresh the candidate metadata first, then check the SDKMAN service page if listing or install commands still fail.

sdk update
sdk list java

For slow networks where the startup health check delays every new shell, open SDKMAN’s config and set sdkman_healthcheck_enable=false. Commands that download SDKs still need a working network connection. If the installer or a candidate download returns a temporary HTTP 503 error, check the SDKMAN service status page, wait briefly, and rerun the same SDKMAN command.

sdk config

Handle Version Mismatch After Switching SDKs

If java -version, mvn -version, or gradle --version shows an unexpected version, confirm the active SDKMAN selection and the command path. The Use state affects the current shell, while Current default is what new shells inherit.

sdk current
command -v java
command -v mvn
command -v gradle

When another package manager also installed the same tool, your shell uses whichever command appears first on PATH. Open a new terminal after changing defaults so the startup file can rebuild SDKMAN’s path entries cleanly.

Remove SDKMAN from Ubuntu

SDKMAN lives in your home directory, so removing it does not uninstall Ubuntu packages. It does delete every SDKMAN-managed JDK, Maven, Gradle, Kotlin, Scala, or other candidate stored under ~/.sdkman.

Back Up SDKMAN Before Removal

Create a backup archive first if you want to preserve downloaded SDKs, local candidates, or configuration files:

if [ -d "$HOME/.sdkman" ]; then
  tar -czf "$HOME/sdkman-backup-$(date +%F-%H%M).tar.gz" -C "$HOME" .sdkman
fi

Delete SDKMAN Files

The next command permanently deletes SDKMAN and every SDK installed under ~/.sdkman. Keep the backup archive if you need to recover a downloaded JDK, build tool, or project-specific local candidate later.

rm -rf "$HOME/.sdkman"

Remove SDKMAN initialization lines from common Bash and Zsh startup files. Each touched file receives a .sdkman.bak backup before the edit.

for file in "$HOME/.bashrc" "$HOME/.bash_profile" "$HOME/.profile" "${ZDOTDIR:-$HOME}/.zshrc"; do
  [ -f "$file" ] || continue
  cp "$file" "$file.sdkman.bak"
  sed -i '/#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!/d; /SDKMAN_DIR=.*\.sdkman/d; /\.sdkman\/bin\/sdkman-init\.sh/d' "$file"
done

Clear the current Bash function and path cache, then verify the sdk command no longer resolves in the current shell:

unset -f sdk 2>/dev/null || true
hash -r
command -v sdk || echo "sdk removed from current shell"
sdk removed from current shell

Conclusion

SDKMAN is ready in your Ubuntu shell with per-user SDKs under ~/.sdkman, so Java and JVM build tools can move independently from APT. When a system-wide runtime fits better, use the package-managed path to install OpenJDK 25 on Ubuntu; for build tooling outside SDKMAN, the Apache Maven on Ubuntu guide pairs well with that setup.

Share this guide

Help another Linux user troubleshoot faster

Share this guide with someone troubleshooting Linux systems or saving it for later.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show more of our fresh Linux tutorials in Top Stories and From your sources when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Verify before posting: