JAVA_HOME on MacOS
This document shows how to install, change, and pick the java version on MacOS
/usr/libexec/java_home
is the simplest maintainable way of setting JAVA_HOME
on macOS.
You can use java_home
to:
Find all installed JDKs
Get value for
JAVA_HOME
for a specific JDK versionGet the value of
JAVA_HOME
for the default JDK versionExecute specific versions of Java commands
Check Installed Java Versions
Check value of current used Java Version
Set JAVA_HOME to specific Java Version
Remove Java SDK
Last updated
Was this helpful?