This is a quick guide to install gradle on your macbook. Two methods are discussed here and you can follow anyone based on your requirements.
Method 1: Automatic installation
- Open terminal app.
- type brew install gradle
- verify using gradle -v
This is the simplest way to install gradle in your mac or any software for that matter but please note that the available version is mostly behind the latest release.
If you want to add the most recent version of gradle, which may be required for you due to specific project needs, please use the method below.
Method 2: Manual setup
- Download the latest version from the Gradle official web-site.
- Create a new directory
sudo mkdir /usr/local/gradle.
- Extract the downloaded Gradle distribution archive by executing
sudo unzip gradle-4.2-all.zip -d /usr/local/gradle.
.bash_profilein your home directory to add
GRADLE_HOMEvariable with the following line
export GRADLE_HOME=/usr/local/gradle/gradle-4.2If you are not sure where is your .bash_profile, just do:
This should open your .bash_profile file. You can now follow the remaining steps below.
- Also update the
PATHvariable to include
$GRADLE_HOME/bin. If you don’t already have the
PATHvariable add the following line
source ~/.bash_profileto executes the update version of
.bash_profile. Or you can open a new
Terminal.appto make this changes active.
- Run gradle -v