Skip to content

Instantly share code, notes, and snippets.

@dogukancagatay
Last active February 6, 2024 09:36
Show Gist options
  • Save dogukancagatay/a438c8261cf35196781dcb2be56b1717 to your computer and use it in GitHub Desktop.
Save dogukancagatay/a438c8261cf35196781dcb2be56b1717 to your computer and use it in GitHub Desktop.
sdkman cheatsheet #sdkman #java

sdkman Cheatsheet

List supported software

sdk list

List Java versions

# sdk list <<software>
sdk list java

Install Java

# sdk install <<software> <<identifier>>
sdk install java 11.0.22-tem

Use a specific version of Java

# sdk use <<software> <<identifier>>
sdk use java 11.0.22-tem

Use the version by default

# sdk default <<software> <<identifier>>
sdk default scala 3.3.1

Setup .sdkmanrc

sdk use java 11.0.22-tem
sdk use maven 3.8.4

# adds .sdkmanrc file
sdk env init 

Install software from .sdkmanrc

sdk env install

Sample .sdkmanrc file

# Add key=value pairs of SDKs to use below
java=11.0.22-tem
maven=3.8.4

Enable sdkman auto environment setup feature

You don't need to run sdk env every time.

sed -i -E 's/sdkman_auto_env=false/sdkman_auto_env=true/' ~/.sdkman/etc/config

Alternatively, you can open the config file and edit futher.

sdk config

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment