Java Version Managers
Compare macOS Java version managers. Simple JDK version switching with JAVA_HOME. Switch between multiple Java versions on Mac globally or per project.
Use a Java version manager when different projects on your Mac need different versions of Java. A legacy application might require Java 8, while new work uses Java 25. Switching between them by hand means editing shell configuration files, setting JAVA_HOME each time, and opening a new terminal window after every change, which is tedious and easy to get wrong.
Most people install one version of Java and never think about which one runs. Experienced Java developers keep several JDKs (Java Development Kits) side by side and let a version manager choose the right one for each project. A project's own settings file names the Java version it needs, so the right version runs as soon as you work in that folder. In this guide I compare seven ways to manage Java versions on a Mac: SDKMAN, mise, Jolta, jEnv, Jabba, asdf, and a manual method that uses the java_home utility built into macOS.
Managing Java versions is one step in setting up a Mac for development. See the full Mac setup roadmap.
Before you get started
Every Java version manager runs its commands in a terminal application. Apple includes the Mac terminal but I prefer Warp Terminal. Warp is an easy-to-use terminal application, with AI assistance to help you learn and remember terminal commands. Download Warp Terminal now; it's FREE and worth a try.
First steps
First, check the macOS version. If you're running an older version, update macOS to the latest macOS version.
Then see which JDKs are already on your Mac. The article Check Java Version on Mac shows how. A version manager can work with the JDKs you have, or install its own.
Recommended Java version managers
I recommend SDKMAN for most Java developers. It installs JDKs, sets JAVA_HOME with no extra configuration, and installs Maven and Gradle alongside your JDKs. If you also work in other languages, such as Node.js, Python, or Ruby, I recommend mise instead. It manages every language through one tool, with fast shell startup.
Here are recommended choices and why you might pick each:
- SDKMAN - for Java and the other languages that run on the Java Virtual Machine (JVM), such as Kotlin and Scala. It installs JDKs, plus Maven, Gradle, and the Spring Boot CLI.
- mise - for developers who use several languages (Java, Node.js, Python, Ruby, and more). It sets JAVA_HOME automatically, keeps every language's version in one file, and adds little to shell startup.
- Jolta - new in 2026 and only for Java. It switches versions automatically for each project from a
.java-versionfile, downloads JDKs when a project needs them, and registers its JDKs with macOS. - jEnv - for developers who install JDKs with Homebrew. It switches between the JDKs you already have.
- Manual method - for one or two JDKs that you rarely switch. It needs no extra tools, only a utility built into macOS.
JAVA_HOME and PATH
Two environment variables control which Java version runs by default:
- JAVA_HOME - build tools such as Maven and Gradle read this variable to find the JDK.
- PATH - when you type
java, your shell searches the folders listed in the PATH to find the program. macOS includes a Java launcher in/usr/binthat starts the newest JDK in the standard JDK folder. A folder that comes earlier in your PATH overrides it.
Version managers work by changing these variables when you switch Java versions. Some set both automatically, while others need extra configuration. The article Set JAVA_HOME on Mac explains the variable in detail, and Java PATH on Mac covers PATH problems.
SDKMAN (recommended for Java-only developers)
SDKMAN (Software Development Kit Manager) is the most popular Java version manager. It installs JDKs from several vendors and also installs the JVM ecosystem's tools, such as Maven, Gradle, Kotlin, and the Spring Boot CLI. It covers everything that runs on the JVM, so it suits developers who work only in Java and related languages.
SDKMAN advantages
- Installs JDKs from several vendors (Temurin, Zulu, Corretto, and GraalVM)
- Installs Maven, Gradle, Kotlin, and the Spring Boot CLI
- Sets JAVA_HOME with no extra configuration
- Switches versions for each project with a
.sdkmanrcfile
SDKMAN disadvantages
- Not in Homebrew's own collection. Its usual installer is a script, which keeps everything in
~/.sdkman. SDKMAN also offers its own Homebrew tap,sdkman/tap/sdkman-cli. - Adds 30 to 300ms to shell startup
- Manages only the JVM's languages, so you need other tools for Node.js, Python, and the rest
- Edits your shell configuration during installation, to put its commands on your PATH
Install SDKMAN
Open a terminal application and run the SDKMAN install script:
$ curl -s "https://get.sdkman.io" | bash
The script adds lines to your shell configuration so that SDKMAN's Java comes first in your PATH, ahead of the macOS Java launcher and any JDK you installed before. Open a new terminal window, then install a JDK into SDKMAN's own folder:
$ sdk install java 25.0.1-tem
Lazy loading for faster shell startup
SDKMAN adds 30 to 300ms to shell startup. If the delay bothers you, load SDKMAN only when you first run an sdk command. Replace SDKMAN's lines in your ~/.zshrc file with this function:
sdk() {
unset -f sdk
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk "$@"
}
Basic SDKMAN commands
List the JDKs SDKMAN can install, switch versions for the current terminal window, and set a default:
$ sdk list java
$ sdk use java 17.0.12-zulu
$ sdk default java 25.0.1-tem
The article Install SDKMAN for Java on Mac covers SDKMAN in full, including project configuration, build tools, and offline mode.
mise (recommended for multiple languages)
Mise (pronounced "MEEZ", from the French "mise en place") manages many languages through a single tool. It handles Java, Node.js, Python, Ruby, Go, and dozens of others, all with the same commands. If you work in several languages, mise replaces a separate version manager for each one.
Mise is written in Rust and runs faster than version managers written as shell scripts. It adds about 10ms to shell startup, compared with 50 to 300ms for SDKMAN or asdf.
mise advantages
- One tool for every language (Java, Node.js, Python, Ruby, Go, and more)
- Fast shell startup (about 10ms)
- Sets JAVA_HOME automatically
- Manages a project's environment variables as well as its tool versions
- Reads asdf's plugins and
.tool-versionsfiles - Active development
mise disadvantages
- Requires
mise trustbefore it applies a project's settings, an extra step when you copy a project from someone else - Doesn't install Maven or Gradle the way SDKMAN does
- Has a shorter history than SDKMAN
Install mise
Install mise with Homebrew:
$ brew install mise
Open the ~/.zshrc shell configuration file and add this line, which turns on mise in every terminal window:
eval "$(mise activate zsh)"
Open a new terminal window so the change takes effect. The articles Shell Configuration and Mac PATH explain shell configuration files and the PATH.
Install Java versions with mise
List the Java versions mise can install:
$ mise ls-remote java
Install Eclipse Temurin 25, the distribution and version I recommend:
$ mise install java@temurin-25
Set it as your default:
$ mise use -g java@temurin-25
Install more versions:
$ mise install java@temurin-17
$ mise install java@zulu-8
Mise sets JAVA_HOME automatically when you switch versions, with no extra configuration. That is a major advantage over asdf, which needs JAVA_HOME set up by hand.
Project configuration
Set a Java version for one project:
$ cd your-project
$ mise use java@temurin-17
The command creates a mise.toml file in the project folder:
[tools]
java = "temurin-17"
Mise switches to this version automatically whenever you work in the folder. Commit mise.toml to Git so that everyone on the project uses the same Java version.
The trust model
Mise won't apply a project's settings until you say you trust them. When you move into a folder with a new mise.toml, run:
$ mise trust
The extra step adds friction, but it protects you. Without it, a settings file in a project you copied from someone else could run commands on your Mac.
Environment variables
Mise manages more than tool versions. Add a project's environment variables to mise.toml:
[tools]
java = "temurin-17"
node = "22"
[env]
JAVA_OPTS = "-Xmx2g"
DATABASE_URL = "postgres://localhost/mydb"
For many projects, that replaces a separate .env file.
Compatibility with .tool-versions
Mise reads asdf's .tool-versions files, so a project set up for asdf works without changes:
java temurin-25
nodejs 22.0.0
python 3.12.0
Jolta (automatic per-project switching)
Jolta is a newer Java version manager, first released in July 2026. Its author describes it as "Like Volta, but for Java" (Volta is a version manager for Node.js). You pin a Java version for a project with jolta pin 21, which writes a .java-version file. From then on, the java and javac commands use that version whenever you work in that folder, with nothing to switch by hand.
Jolta is a single program, written in Rust. It puts small stand-in commands, called shims, for java, javac, jar, and the other JDK tools on your PATH. Each time you run one, Jolta looks for the nearest .java-version file in the current folder or the folders above it, sets JAVA_HOME, and runs the real command from the matching JDK. When no project pins a version, Jolta uses the version you set with jolta default, and then the system Java.
Jolta advantages
- Downloads JDKs when a project needs them. If a project pins a version you don't have, the first
javacommand downloads it. Temurin from Adoptium is the default. Corretto, GraalVM, Oracle, Zulu, Liberica, and SapMachine are also available, as injolta pin corretto@21. - Works with macOS. Jolta links each JDK it installs into
~/Library/Java/JavaVirtualMachinesin your home directory, so macOS's/usr/libexec/java_homeutility, and apps that use it, can find them. It also finds JDKs you installed with Homebrew, the Temurin installer, or SDKMAN. - Keeps JAVA_HOME correct for Maven and Gradle. A shell hook updates JAVA_HOME at the next prompt whenever the pinned version changes, including after a
git checkoutof a branch with a different.java-version. - Reads SDKMAN's
.sdkmanrcfiles, so you can move from SDKMAN without changing your projects. - Needs no administrator password. Everything goes in
~/.joltain your home directory. Thejolta doctorcommand checks the setup. Thejolta implodecommand removes Jolta along with the lines it added to your shell configuration.
Jolta disadvantages
- It is new, with one author. The project started on July 24, 2026. The latest release, 0.8.7, came out on August 20, 2026. There have been no releases or changes since then (as of November 2026). It hasn't reached version 1.0.
- It isn't in Homebrew's own collection. You install it from its author's Homebrew tap, a third-party collection of formulas, or with an install script.
- It manages only Java. It doesn't install Maven or Gradle either (though
jolta toolchains --writegives Maven and Gradle a list of your JDKs). - It edits only
~/.zshrc. Thejolta setupcommand writes its lines to~/.zshrc, with no option to skip that. A script or tool that starts a shell without reading~/.zshrcdoesn't get the JAVA_HOME hook. For those, Jolta's documentation suggestsjolta exec mvn ...oreval "$(jolta env)".
Install Jolta
Install Jolta from its author's Homebrew tap, then run its setup:
$ brew install OneAppPlatform/tap/jolta
$ jolta setup
The jolta setup command creates ~/.jolta and adds two marked blocks to ~/.zshrc, one for the PATH and one for the JAVA_HOME hook. Open a new terminal window, then check the setup:
$ jolta doctor
Pin Java versions with Jolta
Move into a project folder and pin a version:
$ cd my-project
$ jolta pin 21
$ java -version
The jolta pin 21 command writes a .java-version file containing 21. If you don't have Java 21 yet, the java -version command downloads Temurin 21 first.
Set a default for folders with no pin:
$ jolta default 25
List the JDKs Jolta can see, with the active one starred:
$ jolta list
jEnv (for Homebrew-managed JDKs)
The jEnv tool is a lightweight version manager modeled on rbenv, the Ruby version manager. Unlike SDKMAN and mise, jEnv doesn't install JDKs. It manages the JDKs you have already installed, usually with Homebrew. It suits you if you prefer Homebrew for installing software and want as few extra tools as possible.
jEnv advantages
- Simple to understand
- Works with the JDKs you install with Homebrew
- Uses the same commands as rbenv and pyenv, so it is familiar if you use them
- Sets a project's version with a
.java-versionfile
jEnv disadvantages
- Doesn't install JDKs, so you install them separately
- Doesn't set JAVA_HOME until you turn on its export plugin
- Needs
jenv rehashafter you add JDKs - Less active development than SDKMAN or mise
- Its shims add a little time to every Java command
Install jEnv
Install jEnv with Homebrew:
$ brew install jenv
Homebrew already puts the jenv command on your PATH. Open the ~/.zshrc shell configuration file and add this line, which turns on jEnv in every terminal window:
eval "$(jenv init -)"
Open a new terminal window so the change takes effect. (jEnv's own instructions also add $HOME/.jenv/bin to the PATH, but that line is for installs from source, not with Homebrew.) The articles Shell Configuration and .zshrc or .zprofile explain which file holds what.
Install JDKs with Homebrew
Because jEnv manages JDKs you already have, install them with Homebrew casks if they aren't installed yet:
$ brew install --cask temurin@17
$ brew install --cask temurin@25
Homebrew casks install JDKs in /Library/Java/JavaVirtualMachines/, the standard macOS location. The article Brew Install Java - Easy Cask Method explains the Homebrew options in detail.
Register JDKs with jEnv
After installing JDKs, register each one with jEnv:
$ jenv add /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/
$ jenv add /Library/Java/JavaVirtualMachines/temurin-25.jdk/Contents/Home/
List the registered versions:
$ jenv versions
Run jenv rehash
After adding JDKs, update jEnv's shims:
$ jenv rehash
Forgetting this step is a common cause of "command not found" errors. Run jenv rehash whenever you add or remove JDKs.
Turn on the export plugin for JAVA_HOME
By default, jEnv doesn't set JAVA_HOME, so Maven, Gradle, and most IDEs can't find Java. Turn on the export plugin:
$ jenv enable-plugin export
Open a new terminal window, then check that JAVA_HOME is set:
$ echo $JAVA_HOME
This step trips up many new users. Without it, your build tools won't find Java even though the java command works.
Switch between versions with jEnv
Set a default version:
$ jenv global 21
Set a version for one project, which creates a .java-version file:
$ cd your-project
$ jenv local 17
Set a version for the current terminal window only:
$ jenv shell 17
Check the active version:
$ jenv version
I recommend jEnv if you already use similar tools, such as rbenv or pyenv.
Jabba (cross-platform manager)
Jabba is a Java version manager written in Go and distributed as a single program. It was inspired by nvm, the Node.js version manager. It works on macOS, Linux, and Windows. Teams that work on several operating systems get the same tool on each one.
Use the community fork of Jabba
The original Jabba repository (shyiko/jabba) has been abandoned since 2019. The community fork, Jabba-Team/jabba, continues development and supports Apple Silicon. Homebrew's jabba formula installs the fork.
Jabba disadvantages
Jabba doesn't switch versions automatically when you move into a project folder. You run jabba use each time, which makes it less convenient than SDKMAN or mise when you work on several projects.
Jabba has a small community, gets fewer updates, and has less documentation than SDKMAN. For teams that use only Macs, I recommend SDKMAN or mise instead. Jabba makes sense mainly for teams that need the same tool on Mac and Windows computers.
Install Jabba
Install Jabba with Homebrew:
$ brew install jabba
Open the ~/.zshrc shell configuration file and add this line:
[ -s "$HOMEBREW_PREFIX/opt/jabba/jabba.sh" ] && . "$HOMEBREW_PREFIX/opt/jabba/jabba.sh"
Open a new terminal window so the change takes effect.
Install Java versions with Jabba
List the versions Jabba can install:
$ jabba ls-remote
Install a version:
$ jabba install temurin@25
Switch to it:
$ jabba use temurin@25
Set it as your default:
$ jabba alias default temurin@25
asdf (universal version manager)
The asdf tool manages many languages through plugins. You install one tool, then add a plugin for each language you need. If you use several languages, it gives you the same commands for Java, Node.js, Ruby, Python, and dozens of others.
However, the asdf tool is slower than mise and needs more configuration for Java. If you're starting fresh, I recommend mise. This section is for developers who already use asdf for other languages and want to add Java.
asdf advantages
- One tool for every language
- The same commands for every language
- Sets a project's versions with a
.tool-versionsfile - Plugins for many languages
asdf disadvantages
- Slower than mise (50 to 150ms added to shell startup, compared with about 10ms)
- Needs JAVA_HOME set up by hand
- Its plugins add complexity
- Doesn't install Maven or Gradle the way SDKMAN does
Install asdf
Install asdf with Homebrew:
$ brew install asdf
Open the ~/.zprofile shell configuration file and add this line, which puts asdf's shims on your PATH:
export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
Open a new terminal window so the change takes effect.
Install the Java plugin for asdf
Add the Java plugin:
$ asdf plugin add java
Set JAVA_HOME for asdf
Unlike SDKMAN and mise, asdf doesn't set JAVA_HOME for you. Open ~/.zshrc and add this line:
. ~/.asdf/plugins/java/set-java-home.zsh
Open a new terminal window so the change takes effect.
Install Java versions with asdf
List the versions asdf can install:
$ asdf list all java
Show only one distribution:
$ asdf list all java | grep temurin
Install a version:
$ asdf install java temurin-25.0.4+7.0.LTS
Set your default version. The --home option writes it to the .tool-versions file in your home directory:
$ asdf set --home java temurin-25.0.4+7.0.LTS
Set a version for one project:
$ cd your-project
$ asdf set java temurin-17.0.12+7
Older guides use asdf global and asdf local. Version 0.16 of asdf replaced both with asdf set, so they no longer work.
The .tool-versions file
The asdf set command writes a .tool-versions file in the project folder:
java temurin-25.0.4+7.0.LTS
nodejs 22.0.0
ruby 3.3.0
python 3.12.0
Commit this file to Git, so that everyone on your team gets the same Java versions.
Reading .java-version files
The asdf tool can also read jEnv's .java-version files. Add this line to ~/.asdfrc:
legacy_version_file = yes
Then a project set up for jEnv works with asdf without changes.
Manual method (for simple needs)
If you use only one or two Java versions and rarely switch, you may not need a version manager. macOS includes the /usr/libexec/java_home utility, which finds installed JDKs. With a few shell aliases, it gives you basic version switching without any extra tools.
Manual switching advantages
The manual method suits you if you use one Java version most of the time, if your workplace restricts installing tools, or if you want to understand Java configuration before you add a version manager.
Manual switching disadvantages
I recommend a version manager instead if you switch versions often, work on several projects that need different versions, want versions to switch automatically for each project, or want everyone on a team to use the same version without coordinating.
List installed JDKs
The java_home utility finds JDKs in /Library/Java/JavaVirtualMachines/. List every installed JDK, with its version and folder:
$ /usr/libexec/java_home -V
Set JAVA_HOME by hand
Show the folder for a specific version:
$ /usr/libexec/java_home -v 21
To make it your default, open ~/.zprofile and add this line:
export JAVA_HOME=$(/usr/libexec/java_home -v 21)
The article Set JAVA_HOME on Mac explains the variable in detail.
Create shell aliases
Add aliases for switching to ~/.zshrc:
alias java17='export JAVA_HOME=$(/usr/libexec/java_home -v 17)'
alias java21='export JAVA_HOME=$(/usr/libexec/java_home -v 21)'
Or create a function that switches to any version:
jdk() {
export JAVA_HOME=$(/usr/libexec/java_home -v "$1")
java -version
}
Then switch by typing the version number:
$ jdk 17
$ jdk 21
Shell configuration
Each version manager needs lines in your shell configuration files. Here's what each tool adds. The article Shell Configuration explains these files.
SDKMAN
The SDKMAN install script adds these lines automatically:
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
Look in your ~/.zshrc file to see how the script changed it.
mise
Add this line to ~/.zshrc:
eval "$(mise activate zsh)"
jEnv
Add this line to ~/.zshrc:
eval "$(jenv init -)"
Jolta
The jolta setup command adds these lines to ~/.zshrc automatically:
# >>> jolta >>>
export JOLTA_HOME="$HOME/.jolta"
export PATH="$JOLTA_HOME/shims:$JOLTA_HOME/bin:$PATH"
# <<< jolta <<<
# >>> jolta hook (keeps JAVA_HOME in sync with the pin in effect) >>>
eval "$(jolta hook zsh)"
# <<< jolta hook <<<
asdf
Add the PATH line to ~/.zprofile and the JAVA_HOME line to ~/.zshrc:
export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
. ~/.asdf/plugins/java/set-java-home.zsh
Measuring shell startup time
Check how long your shell takes to start:
$ time zsh -i -c exit
Run it several times and average the results. If startup takes more than 500ms, try lazy loading or switch to mise, which starts faster.
Avoid running more than one version manager
Don't turn on more than one Java version manager in your shell, because they conflict with each other. Pick one tool and remove the others' lines from ~/.zprofile and ~/.zshrc.
IDE integration
IntelliJ IDEA
IntelliJ finds JDKs in /Library/Java/JavaVirtualMachines/ automatically. For JDKs that a version manager installed somewhere else, add them by hand:
- Open
File > Project Structure > SDKs. - Click the + button.
- Go to the JDK's folder.
For a JDK that SDKMAN manages, choose a folder such as ~/.sdkman/candidates/java/25.0.1-tem.
IntelliJ's project SDK setting is separate from your shell's JAVA_HOME, so changing one doesn't change the other. Set the project SDK in File > Project Structure > Project.
VS Code
The Extension Pack for Java finds JDKs from JAVA_HOME, the PATH, and the usual installation folders. Add more JDKs in VS Code's settings.json file:
{
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home"
},
{
"name": "JavaSE-25",
"path": "/Library/Java/JavaVirtualMachines/temurin-25.jdk/Contents/Home",
"default": true
}
]
}
Other IDEs
Most IDEs read JAVA_HOME when they start. If you switch Java versions in a terminal window, restart your IDE so it sees the change. Some IDEs remember the Java folder and need to be set up again.
Troubleshooting
"java: command not found" after installation
For SDKMAN, open a new terminal window, or load SDKMAN in the current one:
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
For jEnv, check that its init line is in ~/.zshrc, then open a new terminal window.
For mise, run mise trust if the project has its own mise.toml.
JAVA_HOME not set
For jEnv, turn on the export plugin, then open a new terminal window:
$ jenv enable-plugin export
For asdf, add this line to ~/.zshrc:
. ~/.asdf/plugins/java/set-java-home.zsh
jEnv not recognizing an installed JDK
Update jEnv's shims:
$ jenv rehash
Check that jEnv registered the JDK:
$ jenv versions
mise settings not applying
Mark the project's settings as trusted, in the project folder:
$ mise trust
Check which versions mise is using:
$ mise current
Conflicts between version managers
If you switch from one version manager to another:
- Remove the old tool's lines from
~/.zprofileand~/.zshrc. - Open a new terminal window.
- Run
which javato check that the new tool now provides Java.
SDKMAN and Homebrew conflicts
SDKMAN and Homebrew can share a Mac, but don't install Java with both. If you use SDKMAN, let it manage all your JDKs. Installing them both ways makes it hard to tell which Java is active.
Java version manager comparison
Here's how the version managers compare, feature by feature:
- Installs JDKs - SDKMAN yes, mise yes, jEnv no, Jabba yes, asdf yes, Jolta yes, manual method no
- Sets JAVA_HOME automatically - SDKMAN yes, mise yes, jEnv (with its plugin), Jabba yes, asdf (with extra configuration), Jolta yes, manual method no
- Installs Maven and Gradle - SDKMAN yes, mise (with plugins), jEnv no, Jabba no, asdf (with plugins), Jolta no, manual method no
- Manages other languages - SDKMAN (JVM languages only), mise yes, jEnv no, Jabba no, asdf yes, Jolta no, manual method no
- Switches automatically in a project folder - SDKMAN yes, mise yes, jEnv yes, Jabba no, asdf yes, Jolta yes, manual method no
- Time added to shell startup - SDKMAN 30 to 300ms, mise about 10ms, jEnv about 50ms, Jabba about 10ms, asdf 50 to 150ms, Jolta not measured, manual method none
- Project settings file - SDKMAN
.sdkmanrc, misemise.toml, jEnv.java-version, Jabba.jabbarc, asdf.tool-versions, Jolta.java-version(also reads.sdkmanrc), manual method none - Homebrew install - SDKMAN (its own tap), mise yes, jEnv yes, Jabba yes, asdf yes, Jolta (its author's tap), manual method not needed
Final recommendations
For most Java developers, I recommend SDKMAN. It installs JDKs, sets JAVA_HOME automatically, and installs Maven and Gradle. One tool covers everything that runs on the JVM.
For several languages, I recommend mise. It manages Java alongside Node.js, Python, and Ruby, with fast shell startup. One mise.toml file sets every language's version for a project.
For automatic per-project switching in Java-only work, consider Jolta. It switches versions from a .java-version file, downloads the JDK a project needs, and registers JDKs where macOS looks for them. It is new and has had no release since August 2026, so check its GitHub page for recent activity before you depend on it.
For Homebrew users who want few extra tools, I recommend jEnv. It adds lightweight version switching to the JDKs you installed with Homebrew. Remember to turn on its export plugin and to run jenv rehash.
For simple setups, use the manual method with shell aliases. It needs nothing installed, which is enough if you rarely switch versions.
Now you can choose a Java version manager, set it up, and let each project use the Java version it needs, without editing JAVA_HOME by hand.
Continue setting up your Mac
Don't miss the full visual roadmap and checklist that shows how to set up a Mac for software development, with all the essential tools and settings you might not yet know about.