SDKMan is a tool designed to help developers manage JDK versions within their development environment. Born from the GVM (Groovy Version Manager), it has evolved into a comprehensive SDK versioning system supporting many languages within the Java ecosystem.
For most users, SDKMan provides basic CRUD (Create, Read, Update, Delete) operations for SDKs on their system – listing, removing, installing, and more. You can find a full overview of its usage here: SDKMan.io: Usage
However, I recently discovered a feature that I think is particularly cool: SDKMan environment files. These files function similarly to Python virtual environments, allowing you to define and manage SDK versions on a per-project basis. When you are working with other engineers, with different development environments, this is a great way to get consistency on everyone’s development environment.
Here’s a sample environment file, including support for JDK 25 (Corretto) and SBT:
File (in your project): .sdkmanrc
java=25-amzn
sbt=1.11.6
Execute the command: sdk env install
The tool will kick off downloads, if it hasn’t already, and will manage your
environment in your shell.
How does this work? SDKMan downloads the SDK versions to its ~/.sdkman/candidates/
folder. It then updates your PATH
to
prioritize the environment contained within that folder. This ensures that when you run sbt or java in this environment,
the versions defined in the environment file are preferred.
Even better, this environment persists across sessions whenever you enter the directory – if you have sdkman_auto_env
set to true
(this value is configured in ~/.sdkman/etc/config
).