JAVA INSTALL multi version for MAC
1. AdoptOpenJDK 설치
# brew tap AdoptOpenJDK/openjdk # brew install --cask adoptopenjdk8 # brew install --cask adoptopenjdk11 # /usr/libexec/java_home -V
2. jenv 설치
# brew install jenv
3. jenv 환경 변수 등록
# echo export PATH="$HOME/.jenv/bin:\$PATH" >> ~/.zshrc # echo 'eval "$(jenv init -)"' >> ~/.zshrc # source ~/.zshrc # jenv versions
4. 특정 버전 및 버전 설정
# jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home # jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home # jenv global openjdk64-11.0.11 # jenv local openjdk64-11.0.11 # java -version