Skip to content

Instantly share code, notes, and snippets.

@l1x
Created June 17, 2015 19:24
Show Gist options
  • Save l1x/d8ba66343fceb927d691 to your computer and use it in GitHub Desktop.
Save l1x/d8ba66343fceb927d691 to your computer and use it in GitHub Desktop.
Installing a specific version of Gradle with Homebrew
brew tap homebrew/versions
brew search gradle
brew install homebrew/versions/gradle112
gradle -version
brew link --overwrite gradle112
gradle -version
@OMMHOA
Copy link

OMMHOA commented Mar 23, 2017

this should be updated:
brew tap homebrew/versions
brew search gradle
brew install homebrew/versions/gradle@2.14
gradle --version
brew link --overwrite gradle@2.14
gradle --version

@mishrav
Copy link

mishrav commented Apr 12, 2017

this should be updated:
brew tap homebrew/versions
brew search gradle
brew install homebrew/versions/gradle214
gradle --version
brew link --overwrite gradle214
gradle --version

@morinted
Copy link

morinted commented Jun 5, 2017

Deprecation warning says it can be done now with just:

brew tap homebrew/versions
brew search gradle
brew install gradle@214
gradle --version
brew link --overwrite gradle@214
gradle --version

@jhlee8804
Copy link

brew tap homebrew/versions
brew search gradle
brew install gradle@2.14
gradle --version
brew link --overwrite gradle@2.14
gradle --version

@bgmoon
Copy link

bgmoon commented Apr 2, 2019

brew tap homebrew/versions
Error: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.

This no longer works :(

@bipin-nag
Copy link

This is for installing gradle v4.9
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8eb5e52e70f8fba2f24c65e398d62ad87e092152/Formula/gradle.rb
FInd out formula(ruby script) for the version you need and then install it directly
:)

@csi-lk
Copy link

csi-lk commented Jan 3, 2020

Using @bipin-nag's method above I was able to install 5.6.4 (as 6 isn't working for me)

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/0474aefa73fe6e7a7a68592cb65819d08a9adb31/Formula/gradle.rb

@yahao87
Copy link

yahao87 commented Jan 7, 2020

gradle 5.4.1

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/639b4c8d71af8cae918d771c1a990ae128f94777/Formula/gradle.rb

@milosmns
Copy link

milosmns commented Mar 22, 2020

Gradle 5.6.4 (last 5.x version and the latest (truly) supported by Android as of Q1/2020):

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/be6b82f442d8a72170bde83b2b2e79a66f342259/Formula/gradle.rb

@nhhockeyplayer
Copy link

meanstack@meanstacks-MacBook-Pro api % brew cask install gradle@5.6.4
Error: Cask 'gradle@5.6.4' is unavailable: No Cask with this name exists.

@nhhockeyplayer
Copy link

why wasnt version 6 working for you

why cant w specifically install a peritnet rebvsion insted of the commit install which brew doesnt like

@mariaiano
Copy link

@bipin-nag's method worked like a charm for me - many thanks!

@dimshik100
Copy link

gradle 3.3

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/74edf375423cbdf042bcab464e65f09426c0190f/Formula/gradle.rb

@dimshik100
Copy link

Here is all gradle commits history.

https://gist.github.com/dimshik100/af28c2146651cae9aa9df94b7144f060

You can try to install them by replacing the commit of the relevant version inside the brew command

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/<COMMIT>/Formula/gradle.rb

@tgvdinesh
Copy link

@eyala
Copy link

eyala commented Dec 7, 2020

Looks like installation from a GitHub url doesn't work anymore, but you can download the file and run it locally with
brew install --build-from-source gradle.rb

@ankit-jha
Copy link

Looks like installation from a GitHub url doesn't work anymore, but you can download the file and run it locally with brew install --build-from-source gradle.rb

Thanks

I created gradle.rb for gradle 6.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment