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