☕️자바 𝗝𝗔𝗩𝗔
[Mac] JAVA 11(Zulu JDK11) 다운로드 및 설치
비타민찌
2022. 12. 8. 10:40
728x90
brew 설치
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
zulu java 설치
brew tap mdogan/zulu
==> Tapping mdogan/zulu
Cloning into '/usr/local/Homebrew/Library/Taps/mdogan/homebrew-zulu'...
remote: Enumerating objects: 616, done.
remote: Counting objects: 100% (191/191), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 616 (delta 130), reused 166 (delta 118), pack-reused 425
Receiving objects: 100% (616/616), 177.39 KiB | 1.38 MiB/s, done.
Resolving deltas: 100% (359/359), done.
Tapped 14 casks (55 files, 312.9KB).
brew install zulu-jdk11
==> Downloading https://cdn.azul.com/zulu/bin/zulu11.60.19-ca-jdk11.0.17-macosx_
######################################################################## 100.0%
==> Installing Cask zulu-jdk11
==> Running installer for zulu-jdk11; your password may be necessary.
Package installers may write to any location; options such as `--appdir` are ignored.
Password:
installer: Package name is Azul Zulu JDK 11.60+19
installer: Installing at base path /
installer: The install was successful.
🍺 zulu-jdk11 was successfully installed!
버전 확인
java --version
openjdk 11.0.17 2022-10-18 LTS
OpenJDK Runtime Environment Zulu11.60+19-CA (build 11.0.17+8-LTS)
OpenJDK 64-Bit Server VM Zulu11.60+19-CA (build 11.0.17+8-LTS, mixed mode)
설치 경로 확인
/usr/libexec/java_home -v 11
/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
.zshrc 편집
vi ~/.zshrc
편집 모드에서 다음과 같이 JAVA_HOME 환경 변수 등록
export JAVA_HOME=`/usr/libexec/java_home -v 11`
export PATH=$PATH:$JAVA_HOME/bin
저장 사항 적용
source ~/.zshrc
* source 명령어란?
스크립트 파일을 수정한 후에 수정된 값을 바로 적용하기 위해 사용하는 명령어다. ~/.bashrc 파일을 수정 후 저장하여도 수정한 내용이 바로 적용되지 않는다. ~/bashrc 파일은 유저가 로그인 할 때 읽어들이는 파일이기 때문에, 로그아웃 후 로그인하거나 리눅스를 재시작해야 적용이 된다.
환경 변수 확인
echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home
728x90