有没有办法查看任何已安装的 brew 包是否具有特定的依赖性?

Is there a way to see if any installed brew package has a specific dependency?

and this one 如果您想列出所有包依赖项并手动检查每个依赖项,则提供信息。在我的系统上,一些包有超过 30 个依赖项。我正在检查每个已安装的软件包,试图找到哪个软件包具有 java 依赖性。

我正在尝试以一种方式查看所有已安装的软件包,包括使用 cask 安装的软件包。有没有办法查看任何已安装的 brew 包是否具有特定的依赖关系?

要根据 java 软件包使用查看所有已安装的软件包:

brew uses --recursive --installed java

根据man brew:

uses [options] formula [...]
   Show  formulae  and  casks that specify formula as a dependency; that is, show dependents of formula. When given multiple formula argu-
   ments, show the intersection of formulae that use formula. By default, uses shows all formulae and casks  that  specify  formula  as a
   required or recommended dependency for their stable builds.

   --recursive
          Resolve more than one level of dependencies.

   --installed
          Only list formulae and casks that are currently installed.