The school program didn't support java10 on my mac, so I wanted to be able to switch to java8. Also, it seems that java8 cannot be used due to the license.
java10
$ export JAVA_HOME=`/usr/libexec/java_home -v "10"`
$ PATH=${JAVA_HOME}/bin:${PATH}
java8(AdoptOpenJDK8)
$ export JAVA_HOME=`/usr/libexec/java_home -v "1.8"`
$ PATH=${JAVA_HOME}/bin:${PATH}
$ brew tap homebrew/cask-versions
$ brew cask install adoptopenjdk8
Use multiple versions of Java with Brew on Mac
Recommended Posts