
Description
第二章 安装Java和本书用例
JAVA安装
2.在命令行下执行下面的命令来安装 Java。
brew cask install java
//报错信息:Error: Calling brew cask install
is disabled! Use brew install [--cask] instead.
查阅资料得知此条命令在2020-12-21被禁用。
附上homebrew维护人员的最新回复:
Hi there, Homebrew maintainer here.
I can clear up a few things:
brew cask commands were deprecated on 2020-12-01 with the release of Homebrew 2.6.0. Starting then, all brew cask commands succeeded but displayed a warning informing users that the command would soon be disabled. The message also provides the appropriate replacement.
brew cask commands were disabled on 2020-12-21 with the release of Homebrew 2.7.0. Starting then, all brew cask commands failed and displayed a warning informing users that the command is disabled. The message also provides the appropriate replacement.
With the release of Homebrew 2.8.0 (release date TBD), this disable message will be removed.
The alternative to brew cask is to use brew . In many cases, you can add the --cask flag to specify casks only. For example, brew cask install atom is now brew install atom or brew install --cask atom. There are some casks that share a name with formulae (e.g. wireshark) so adding --cask ensures that the cask is installed not the formula.
I'm not much of an ansible user but I'm happy to try and help out if needed. Feel free to point me in the right direction if anything is blocked and could use feedback from the Homebrew side of things.