Using Java8 on MacOS


brew install --cask AdoptOpenJDK/openjdk/adoptopenjdk{8,11}
brew install --cask java8# open .zshrc using favorite editor (in my case, it is vscode)
code ~/.zshrc
# add the following lines
JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
export JAVA_HOME
# run the following line
source ~/.zshrc
# if using jenv for managing java versions
jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/
jenv versions

References:

--

--