Guide
A Java version manager for Mac that switches the JDK per folder
Last checked 17 November 2026
In short: Termhint's runtime manager installs Eclipse Temurin JDKs from Adoptium, refuses any archive whose checksum or Adoptium signature does not match, and switches java and JAVA_HOME when you change folders, from .java-version or .tool-versions. SDKMAN! offers many more JDK builds and other JVM tools; jEnv switches JDKs you installed yourself; Homebrew's openjdk gives you one JDK per formula.
Install and switch a JDK
termhint runtime list-remote java # Temurin builds for this Mac
termhint runtime install java 21 # the newest 21.x
termhint runtime use java 17 # pin here: writes .tool-versions in this folder
termhint runtime use -g java 21 # the default outside pinned folders
termhint runtime current # what this folder asks for, and whether it is installed
termhint runtime exec java@17 -- ./gradlew build # for scripts and cron, where no prompt runs
The same commands are in Settings → Runtimes. Termhint is a menu-bar app for macOS 14 or later on Apple silicon.
Which JDK it downloads, and how it is checked
- Vendor: Eclipse Temurin, the JDK builds from Adoptium, listed through Adoptium's API. Only macOS JDK archives for your Mac's architecture are offered, and only from Adoptium's own GitHub releases.
- Verification: the archive must match the SHA-256 the API publishes and carry a valid OpenPGP signature from Adoptium's release key, which is built into Termhint. Temurin builds from before mid-2022 have no published signature, so they are refused. A failed check is a refusal, never a warning.
- Layout: the JDK's
Contents/Homebecomes the install folder, soJAVA_HOMEpoints at it directly, and it stays a valid macOS JDK bundle.
Other vendors (Zulu, Corretto, GraalVM, Liberica) are not offered.
Switching the JDK per folder
When you change folders, zsh (and bash, if you set it up there) picks the Java version without starting a process. The first answer wins:
TERMHINT_JAVA_VERSIONin the environment.- Walking up from the folder: the nearest
.tool-versionsline forjava, or a.java-versionfile. In one folder,.tool-versionscomes first. - Your default in
~/.config/termhint/tool-versions.
Version files are read as data, never run. system means "leave Java alone". .sdkmanrc is not read; put the version in .java-version or .tool-versions instead.
Termhint, SDKMAN!, jEnv and Homebrew compared
| Installs JDKs | Per-folder file | How it switches | |
|---|---|---|---|
| SDKMAN! | Yes, many vendors (versions like 21.0.4-tem), plus Gradle, Maven, Scala and other SDKs | .sdkmanrc | sdk env, or automatically on cd with sdkman_auto_env=true |
| jEnv | No: "Use your platform appropriate package manager to install java" | .java-version | Shims; JAVA_HOME with its export plugin |
| Homebrew openjdk | Yes, OpenJDK built by Homebrew; openjdk is the newest, versioned formulae such as openjdk@21 for others | None | You change PATH, or link the JDK into /Library/Java/JavaVirtualMachines (its caveat) |
| Termhint | Temurin only, signature checked | .java-version, .tool-versions | The shell integration on each prompt; sets JAVA_HOME |
SDKMAN! from its usage page; jEnv from its README; Homebrew from the openjdk formula page.
Which Java version manager is best for you
- Pick SDKMAN! if you need a vendor other than Temurin, or want Gradle, Maven, Kotlin and Scala managed in the same tool.
- Pick jEnv if you already install JDKs another way and only want switching.
- Pick Homebrew if one or two OpenJDK builds from Homebrew are enough.
- Pick Termhint if you want Temurin with a checked signature,
.java-versionand.tool-versionshonoured, and Node, Python, Go, Ruby and Xcode in the same place.
Moving from SDKMAN! or jEnv
termhint runtime migrate --dry-run sdkman jenv # what would move
termhint runtime migrate sdkman # install the same Java versions, set the default, turn SDKMAN! off
Migrate installs the manager's Java versions with Termhint, makes its default the global one and turns its lines in ~/.zshrc and the other shell files off (backed up first). Two builds of one version, such as SDKMAN!'s 21.0.1-tem and 21.0.1-zulu, install once, as Temurin. SDKMAN!'s other candidates (Gradle, Maven, …) are listed but not moved. --undo turns the manager back on. See also asdf and mise for .tool-versions.