Skip to content

Instantly share code, notes, and snippets.

View joulgs's full-sized avatar
🎯
Focusing

Jonathas Soares joulgs

🎯
Focusing
View GitHub Profile
@joulgs
joulgs / sdkman-vs-jenv.md
Created March 24, 2024 11:36 — forked from tfield/sdkman-vs-jenv.md
SDKMAN vs JENV

sdkman vs jenv

Jenv is great, but the JDKs have to be manually installed. If you need more than just a couple of them, you'll want to be able to install them via command line, and sdkman provides this capability very cleanly for java. So... is it possible to work with both sdkman and jenv? Yes and no. Some tricks will allow you to tell jenv about the java versions that are managed by sdkman, but setting defaults (using jenv local 17.0 for instance) does not work very well. Time for a cleaner solution. Sdkman provides all of the same functionality, with more power and a slightly different (but equally simple) syntax. I've switched from jenv to sdkman. Here's my cheat sheet.

Setup

Download and install sdkman. Follow the required instructions after installing. Then, run the config command to enable auto_env support.

echo “Installing SDKMAN"
curl -s https://get.sdkman.io | bash