MAC电脑安装openJdk

一、安全brew软件

[1]安全命令地址:https://brew.sh/index_zh-cn

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
View Code

[2] 如命令无法使用则需要改host:https://blog.csdn.net/txl910514/article/details/105880125

macOS安装Homebrew时总是报错(Failed to connect to raw.githubusercontent.com port 443: Connection refused)

原因:由于某些你懂的因素,导致GitHub的raw.githubusercontent.com域名解析被污染了。


解决办法:通过修改hosts解决此问题。

查询真实IP

在https://www.ipaddress.com/查询raw.githubusercontent.com的真实IP。

sudo vim /etc/hosts

添加内容如下:
199.232.28.133 raw.githubusercontent.com
View Code

二、安装open-jdk

https://www.jianshu.com/p/8e82d7429528

原文地址:https://www.cnblogs.com/shangxiaofei/p/13922714.html