http://snowdeer.github.io/mac-os/2018/11/03/how-to-set-java-home-env-on-mac/
/usr/libexec/java_home -V
~ /usr/libexec/java_home -V
Matching Java Virtual Machines (1):
17.0.3.1 (arm64) "Oracle Corporation" - "Java SE 17.0.3.1" /Library/Java/JavaVirtualMachines/jdk-17.0.3.1.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-17.0.3.1.jdk/Contents/Home
nano .zshrc
# JAVA HOME
export JAVA_HOME=`/usr/libexec/java_home -v 17`
# If you come from bash you might have to change your $PATH.
export PATH=${JAVA_HOME}/bin:$HOME/bin:/usr/local/bin:$PATH