首页 > 解决方案 > brew 不安装 gradle 6

问题描述

除了使用 brew 安装 gradle 7 之外,我无法安装任何东西。 https://formulae.brew.sh/formula/gradle#default

如何下载旧版本作为 google 中的答案在最新的 brew 中不起作用。最好没有 sdkman,因为我不想要另一个包管理器。

命令brew search gradle只显示一个版本的 gradle。

使用的命令

brew install gradle

brew install gradle@6

标签: gradlehomebrew

解决方案


brew install gradle@6我按照输出中的说明设法让 gradle 6.x 工作

==> Caveats
gradle@6 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have gradle@6 first in your PATH, run:
  echo 'export PATH="/usr/local/opt/gradle@6/bin:$PATH"' >> ~/.profile

更新后~/.profile重新加载

source ~/.profile

或打开新的终端会话。


推荐阅读