

This also sets the JAVA_HOME environment variable to ~/.sdkman/candidates/java/current.ī. To set one of the Java versions installed using SDKMAN! (no matter if installed using its built-in installer or from a local directory) as the default Java version, use:įor example, to make AdoptOpenJDK version 11.0.8.hs the default system Java version, use: activate a particular Java version when you enter a directory.


Use this command to list all the candidate Java versions: Now that SDKMAN! is installed, let's put it to use. To get started, install the SDKMAN! command line interface. This article shows how to install Java using SDKMAN! (using its installer, or offline using your own Java binaries), and how to manage and use multiple Java versions (easily setting a Java version as default, including setting the JAVA_HOME environment variable, or switching Java versions temporarily for the current terminal session, or only for a particular directory).ġ. The tool was inspired by RVM and rbenv, and it only requires curl and zip / unzip to be present on your system to work, being written in Bash (don't worry, it works with Zsh too). It can install and manage Java, Groovy, Scala, Kotlin, Ceylon, Ant, Gradle, and many more. SDKMAN! is a tool to manage multiple versions of software development kits on macOS, Linux, WLS, Cygwin, Solaris and FreeBSD.
