MacOS Big Sur 通过brew 安装OpenJDK8(AdoptOpenJDK8)
作者:互联网
目录
问题二:Failed to connect to github.com port 443: Operation timed out
本文主要介绍最新版mac(MacOS big sur)如何安装java8环境。其他java环境相同。
一、安装方法
首先我们使用如下命令。
$ brew tap AdoptOpenJDK/openjdk
$ brew install --cask <version>
##java8
$ brew install --cask adoptopenjdk8
对应的java的版本list
Java Version | JDK | JRE |
---|---|---|
Latest OpenJDK with Hotspot JVM | adoptopenjdk | adoptopenjdk-jre |
Latest OpenJDK with OpenJ9 JVM | adoptopenjdk-openj9 | adoptopenjdk-openj9-jre |
OpenJDK8 with Hotspot JVM | adoptopenjdk8 | adoptopenjdk8-jre |
OpenJDK8 with OpenJ9 JVM | adoptopenjdk8-openj9 | adoptopenjdk8-openj9-jre |
OpenJDK9 with Hotspot JVM | adoptopenjdk9 | n/a |
OpenJDK10 with Hotspot JVM | adoptopenjdk10 | n/a |
OpenJDK11 with Hotspot JVM | adoptopenjdk11 | adoptopenjdk11-jre |
OpenJDK11 with OpenJ9 JVM | adoptopenjdk11-openj9 | adoptopenjdk11-openj9-jre |
OpenJDK12 with Hotspot JVM | adoptopenjdk12 | adoptopenjdk12-jre |
OpenJDK12 with OpenJ9 JVM | adoptopenjdk12-openj9 | adoptopenjdk12-openj9-jre |
OpenJDK13 with Hotspot JVM | adoptopenjdk13 | adoptopenjdk13-jre |
OpenJDK13 with OpenJ9 JVM | adoptopenjdk13-openj9 | adoptopenjdk13-openj9-jre |
OpenJDK14 with Hotspot JVM | adoptopenjdk14 | adoptopenjdk14-jre |
OpenJDK14 with OpenJ9 JVM | adoptopenjdk14-openj9 | adoptopenjdk14-openj9-jre |
OpenJDK15 with Hotspot JVM | adoptopenjdk15 | adoptopenjdk15-jre |
OpenJDK15 with OpenJ9 JVM | adoptopenjdk15-openj9 | adoptopenjdk15-openj9-jre |
OpenJDK16 with Hotspot JVM | adoptopenjdk16 | adoptopenjdk16-jre |
OpenJDK16 with OpenJ9 JVM | adoptopenjdk16-openj9 | adoptopenjdk16-openj9-jre |
详细可以查看下面的链接
https://github.com/adoptopenjdk/homebrew-openjdk/
二、问题列表
问题一:但是如果执行上面的命令出现下面的错误的话
MacBook-Pro ~ % brew install adoptopenjdk8
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask-versions).
==> Updated Casks
Updated 1 cask.
Error: Cask adoptopenjdk8 exists in multiple taps:
homebrew/cask-versions/adoptopenjdk8
adoptopenjdk/openjdk/adoptopenjdk8
我们就需要使用下面的命令进行安全
brew install adoptopenjdk/openjdk/adoptopenjdk8
参考下面的解决办法:
https://stackoverflow.com/questions/24342886/how-to-install-java-8-on-mac
如果遇到问题
问题二:Failed to connect to github.com port 443: Operation timed out
可以参考下面的文章
https://www.jianshu.com/p/f7ab570b53ba
标签:MacOS,cask,Big,Hotspot,adoptopenjdk8,brew,OpenJ9,AdoptOpenJDK8,openj9 来源: https://blog.csdn.net/xiangzaixiansheng/article/details/117419216