SDKMAN! - ivmg5/dotfiles GitHub Wiki
SDKMAN! is installed with:
curl -s https://get.sdkman.io | bash
That’s all you need to get started.
Managing Java, Scala, Kotlin, and other SDKs manually is a hassle: downloading, unpacking, updating, and switching versions can quickly get messy. SDKMAN! makes it painless—it handles installation, upgrades, and switching between SDK versions with simple commands. It also supports per-project versions via .sdkmanrc
, so each project can define exactly which SDK it needs. This keeps environments consistent and avoids version conflicts.
I recommend copying the .zshrc
from my dotfiles first.
The only file in my dotfiles related to SDKMAN! is:
~/.sdkman/etc/config
That file controls SDKMAN!’s behavior—things like enabling auto-completion, colorized output, automatic environment switching, and update settings. With it in place, SDKMAN! works smoothly and with minimal manual configuration.
First check what’s available:
sdk list # Shows all available SDK candidates
sdk list <sdk> # Lists versions for a specific SDK
Then install:
sdk install <sdk> # Latest stable version (ex: sdk install java)
sdk install <sdk> <version> # Specific version (ex: sdk install scala 3.4.2)
sdk uninstall <sdk> <version>
sdk use <sdk> <version> # Current terminal only
sdk default <sdk> <version> # Set as default for all terminals
Check what’s active:
sdk current # Shows all SDKs in use
sdk current <sdk> # Shows version for a specific SDK
sdk update # Refresh cache and check for new SDKs
sdk upgrade # Update all outdated SDKs
sdk upgrade <sdk> # Update a specific SDK
sdk env init # Creates a .sdkmanrc with current version
sdk env install # Installs missing SDKs defined in .sdkmanrc
sdk env clear # Restore defaults after leaving project
With .sdkmanrc
in place, the correct SDK version activates automatically when you enter the project directory.