使用brew安裝OpenJDK 8在MacOS中(AdoptopenJDK)
使用brew安裝OpenJDK 8在MacOS中(AdoptopenJDK)
系統要求:先安裝Homebrew, 如果還沒安裝,可參考這篇 裡面有詳細教程:
安裝Homebrew指令如下:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
步驟1.: 先設定brew讓brew有openjdk的repo.
brew tap AdoptOpenJDK/openjdk
步驟2.:安裝Mac版的openJDK8
brew install --cask homebrew/cask-versions/adoptopenjdk8
步驟3.:測試jdk版本:
java -version
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.282-b08, mixed mode)
步驟4.確認java安裝的位置:
which java
/usr/bin/java
that's it.
留言
張貼留言