jEnv로 자바 환경 세팅
Java 설치
> brew search jdk
==> Formulae
openjdk ✔ openjdk@11 ✔
==> Casks
adoptopenjdk adoptopenjdk12-openj9 adoptopenjdk14 adoptopenjdk8-openj9-jre
adoptopenjdk10 adoptopenjdk12-openj9-jre adoptopenjdk14-jre adoptopenjdk8-openj9-jre-large
adoptopenjdk11 adoptopenjdk12-openj9-jre-large adoptopenjdk14-openj9 adoptopenjdk8-openj9-large
adoptopenjdk11-jre adoptopenjdk12-openj9-large adoptopenjdk14-openj9-jre adoptopenjdk9
adoptopenjdk11-openj9 adoptopenjdk13 ✔ adoptopenjdk14-openj9-jre-large jdk-mission-control
adoptopenjdk11-openj9-jre adoptopenjdk13-jre adoptopenjdk14-openj9-large oracle-jdk
adoptopenjdk11-openj9-jre-large adoptopenjdk13-openj9 adoptopenjdk8 ✔ oracle-jdk-javadoc
adoptopenjdk11-openj9-large adoptopenjdk13-openj9-jre adoptopenjdk8 ✔ sapmachine-jdk
adoptopenjdk12 adoptopenjdk13-openj9-jre-large adoptopenjdk8-jre
adoptopenjdk12-jre adoptopenjdk13-openj9-large adoptopenjdk8-openj9
> brew install openjdk
> brew cask install adoptopenjdk8
jEnv 설치
> brew install jenv
> echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
> echo 'eval "$(jenv init -)"' >> ~/.zshrc
> source ~/.zshrc
JDK jEnv 설정
# adoptopenjdk 8
> jenv add /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
# openjdk (13)
> jenv add /usr/local/opt/openjdk
# 확인
> jenv versions
system
openjdk64-1.8.0.242
openjdk64-13.0.2
글로벌 Java 버전 설정
$ jenv global openjdk64-13.0.2
로컬 Java 버전 설정 (디렉토리별)
$ jenv local openjdk64-1.8.0.242
쉘 Java 버전 설정
$ jenv shell openjdk64-13.0.2