macOS安装Java8

July 14, 2019

开发库如 GradleJava11 之间存在兼容问题需用旧版本 Java,但安装旧版本无法用以下命令获取

1
brew install java8

Homebrew 会找不到该库而报错

1
2
3
4
5
6
7
8
Error: No available formula with the name "java8"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

得先获取 cask-versions

1
brew tap homebrew/cask-versions

cask-versions 安装 JDK8

1
brew cask install homebrew/cask-versions/adoptopenjdk8