Java 自制程序安装

Java Homebrew installation

我正在尝试在我的 Mac 上安装 Homebrew,以便与 Java 开发一起使用。我已按照以下说明进行操作:https://brew.sh,并将命令:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 粘贴到我的终端中。

当我这样做时,执行了一些脚本,我得到了输出:

MacBook-Pro:~ me$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

==> This script will install:

/usr/local/bin/brew

/usr/local/share/doc/homebrew

/usr/local/share/man/man1/brew.1

/usr/local/share/zsh/site-functions/_brew

/usr/local/etc/bash_completion.d/brew

/usr/local/Homebrew

Press RETURN to continue or any other key to abort

==> /usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew

Password:

==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew

==> /usr/bin/sudo /usr/sbin/chown me /Library/Caches/Homebrew

==> Downloading and installing Homebrew...

remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0

HEAD is now at ea8be17 Merge pull request #2631 from GauthamGoli/audit_homepage_rubocop

==> Cleaning up /Library/Caches/Homebrew...

==> Migrating /Library/Caches/Homebrew to /Users/me/Library/Caches/Homeb

==> Deleting /Library/Caches/Homebrew...

Already up-to-date.

Error: Could not link:

/usr/local/etc/bash_completion.d/brew

Please delete these paths and run brew update.

Error: Failed to link all completions, docs and manpages:

Permission denied - (../../../Homebrew/completions/zsh/_brew_cask, /usr/local/share/zsh/site-functions/_brew_cask)

Failed during: /usr/local/bin/brew update --force

MacBook-Pro:~ me$

所以输出告诉我它已经是最新的,大概是因为我已经尝试安装过一两次了吧?

如何删除 运行 brew update 的路径,就像它告诉我的那样?

我遇到了这个错误。解决方法是 运行 命令 sudo chown -R $USER:admin /usr/local/*,如 Tech Stacker blog post that solves this issue.

中所述