brew doesn't install gradle 6

Viewed 1326

I'm not able to install anything but gradle 7 with brew. https://formulae.brew.sh/formula/gradle#default

How can I download an older version as the answers in google arent working in latest brew. Preferably without sdkman as I don't want yet another packagemanager.

command brew search gradle only shows one version of gradle.

Commands used

brew install gradle

brew install gradle@6
1 Answers

I managed to get gradle 6.x working by following instructions from brew install gradle@6 output

==> 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

After updating ~/.profile reload it

source ~/.profile

or open new terminal session.

Related