Setting Up Gradle¶
Gradle runs on all major operating systems and requires a Java Development Kit (JDK) version 17 or higher. To check your Java version, run java -version.
MacOS¶
Installation via Homebrew¶
You can install Gradle using Homebrew:
brew install gradle
Manual Installation¶
- Download the latest binary-only (
bin) distribution ZIP from the Gradle releases page. - Unpack the distribution into a directory of your choice, e.g.,
/usr/local/gradle: You can do this by running the following commands in your terminal, replacingx.y.zwith the version number of the Gradle distribution you downloaded, and ensuring your terminal is in the directory where you downloaded the file. The default location for this is the Downloads folder, which you can navigate to by runningcd ~/Downloadsin your terminal. The following commands will create a directory calledgradlein your home folder, and then unzip the Gradle distribution into that directory as required:mkdir /usr/local/gradle unzip gradle-x.y.z-bin.zip -d /usr/local/gradle - Configure your system environment by updating your
PATHand settingGRADLE_HOME. It is recommended to add this to your~/.bash_profileor~/.zshrc:export GRADLE_HOME=/usr/local/gradle/gradle-x.y.z export PATH=$GRADLE_HOME/bin:$PATH - Reload your shell configuration:
source ~/.zshrc
Linux¶
Manual Installation¶
- Download the latest binary-only (
bin) distribution ZIP from the Gradle releases page. - Unpack the distribution into a directory of your choice, e.g.,
/opt/gradle: You can do this by running the following commands in your terminal, replacingx.y.zwith the version number of the Gradle distribution you downloaded, and ensuring your terminal is in the directory where you downloaded the file. The default location for this is the Downloads folder, which you can navigate to by runningcd ~/Downloadsin your terminal. The following commands will create a directory calledgradlein your home folder, and then unzip the Gradle distribution into that directory as required:mkdir /opt/gradle unzip -d /opt/gradle gradle-x.y.z-bin.zip - Configure your system environment by updating your
PATHand settingGRADLE_HOME. Add the following to your~/.bashrc:export GRADLE_HOME=/opt/gradle/gradle-x.y.z export PATH=$GRADLE_HOME/bin:$PATH - Reload your shell configuration:
source ~/.bashrc
Windows¶
Manual Installation¶
- Download the latest binary-only (
bin) distribution ZIP from the Gradle releases page. - Create a new directory
C:\Gradleusing File Explorer. - Extract the contents of the ZIP archive into
C:\Gradle(e.g., resulting inC:\Gradle\gradle-x.y.z). - Configure your system environment by adding the path to your system variables:
- In File Explorer, right-click on This PC (or Computer), then click Properties → Advanced System Settings → Environment Variables.
- Under System Variables, click New to create a new variable:
- Variable name:
GRADLE_HOME - Variable value:
C:\Gradle\gradle-x.y.z
- Variable name:
- Still under System Variables, locate the
Pathvariable, select it, and click Edit. - Add a new entry for
%GRADLE_HOME%\bin(orC:\Gradle\gradle-x.y.z\bin). - Click OK on all dialogs to save the changes.
Verification (All Systems)¶
To verify your installation, open a new command prompt or terminal and execute:
gradle -v