Java Configuration Environment in macOS

Where can I specify my default java runtime environment in sequoia, please?, if I have installed multiple jre.


whence is showing /usr/bin/java which is not pre-installed.


preferable the future proof OS configuration point. thx

iMac 27″, macOS 10.12

Posted on Aug 20, 2025 05:40 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 20, 2025 11:05 AM

There is no pre-installed Java version in MacOS - Apple stopped bundling it several versions ago.


That's not to say you can't install it yourself, but it's up to you - https://java.com/


If you have multiple versions of Java installed, the standard method of switching versions is by defining the environment variable $JAVA_HOME to point to the version you want to use.


The specifics on how to do that may vary depending on the version of MacOS you're running and your preferred shell. The default shell in recent OS versions is zsh, so adding:


export JAVA_HOME=/usr


to ~/.zshrc would set the default $JAVA_HOME to /usr, but you can point to any other installed version.

1 reply
Question marked as Top-ranking reply

Aug 20, 2025 11:05 AM in response to _140

There is no pre-installed Java version in MacOS - Apple stopped bundling it several versions ago.


That's not to say you can't install it yourself, but it's up to you - https://java.com/


If you have multiple versions of Java installed, the standard method of switching versions is by defining the environment variable $JAVA_HOME to point to the version you want to use.


The specifics on how to do that may vary depending on the version of MacOS you're running and your preferred shell. The default shell in recent OS versions is zsh, so adding:


export JAVA_HOME=/usr


to ~/.zshrc would set the default $JAVA_HOME to /usr, but you can point to any other installed version.

Java Configuration Environment in macOS

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.