One option to install java on mac is AdoptOpenJDK with homebrew: brew install -cask adoptopenjdk with ` brew install -cask adoptopenjdk8/11/14/15`Įxport JAVA_HOME=$(/usr/libexec/java_home -v '$1') In a nutshell # assuming versions below are installed This one is about how to change and persist the java version on macOS 11 BigSur in a shell script.
Setting the java version on BigSur macOS 11 changed compare to setting the java version on earlier macOS versions.