SDKMAN! – The Best Tool for Managing Java Versions

posted 2 min read

SDKMAN! – The Best Tool for Managing Java Versions

Introduction

If you often need to switch between Java Development Kit (JDK) versions for multiple projects, you know how time-consuming it can be. Manually installing and switching JDKs is tedious and frustrating. SDKMAN! (Software Development Kit Manager) provides a simple and efficient way to install, manage, and switch between various JDK versions effortlessly.

Without this tool, comparing different Java versions can be a real pain! All those endless changes to JAVA_HOME—ahhh!

What is SDKMAN!?

SDKMAN! is a command-line tool that allows developers to easily install and manage various software development kits (SDKs), including Java, Kotlin, Scala, and more. It works on macOS, Linux, and Windows (WSL) and supports multiple Java vendors, including OpenJDK, Oracle JDK, GraalVM, and Zulu.

How to Install SDKMAN!

Installing SDKMAN! is straightforward. Open a terminal and run:

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

After installation, restart your terminal or run:

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

Verify the installation:

sdk version

If everything is set up correctly, you should see output similar to this:

SDKMAN!  
script: 5.19.0  
native: 0.5.0 

Using SDKMAN! for Java Management

1️⃣ Installing Java Versions

Check available JDKs:

sdk list java

For example, my output looks like this:

To install a specific JDK version, use:

sdk install java 23.0.2-graalce
 

2️⃣ Switching Between Java Versions

To temporarily switch to a different Java version, use:

sdk use java 17.0.8-tem

To set a default version for all projects:

sdk default java 23.0.2-graalce

3️⃣ Setting Project-Specific Java Versions

Inside your project directory, initialize SDKMAN!'s environment:

sdk env init

This creates a .sdkmanrc file with default content like this:

# Enable auto-env through the sdkman_auto_env config  
# Add key=value pairs of SDKs to use below  
java=23.0.2-graalce 

Edit this file to specify your required Java version. Then activate it with:

sdk env

Now, every time you enter the project directory, SDKMAN! will automatically switch to the correct JDK version!

Why Use SDKMAN!?

Simple Installation & Updates – Install and update SDKs with a single command.

Supports Multiple JDK Vendors – OpenJDK, GraalVM, Zulu, Oracle JDK, etc.

Instant Switching – No need to modify system variables manually.

Project-Specific Environments – Automatically switches JDK versions per project.

SDKMAN! vs. Other Tools

Feature SDKMAN! Homebrew + jEnv ASDF
Supports multiple JDK vendors ❌ (Only OpenJDK)
Project-specific Java versions
Works on macOS/Linux/WSL
Manages other SDKs (Scala, Kotlin, etc.)

Conclusion

SDKMAN! is an essential tool for Java developers, making JDK management effortless. Whether you're working with OpenJDK, GraalVM, or another distribution, SDKMAN! lets you install, switch, and manage Java versions easily.

This tool has personally helped me compare different Java runtime versions and saved me a ton of time when migrating multiple projects from one version to another. If you're tired of constantly tweaking JAVA_HOME, give SDKMAN! a try!

More Posts

Optimizing the Clinical Interface: Data Management for Efficient Medical Outcomes

Huifer - Jan 26

The Audit Trail of Things: Using Hashgraph as a Digital Caliper for Provenance

Ken W. Algerverified - Apr 28

Managing Multiple Xcode Versions with Xcodes.app

Mark Kazakov - Dec 13, 2025

Local-First: The Browser as the Vault

Pocket Portfolio - Apr 20

Handling Large Graphs in Java with Streams: Patterns, Challenges, and Best Practices

Aditya Pratap Bhuyan - Jun 8, 2025
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!