Skip to content

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

  1. Download the latest binary-only (bin) distribution ZIP from the Gradle releases page.
  2. 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, replacing x.y.z with 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 running cd ~/Downloads in your terminal. The following commands will create a directory called gradle in 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
    
  3. Configure your system environment by updating your PATH and setting GRADLE_HOME. It is recommended to add this to your ~/.bash_profile or ~/.zshrc:
    export GRADLE_HOME=/usr/local/gradle/gradle-x.y.z
    export PATH=$GRADLE_HOME/bin:$PATH
    
  4. Reload your shell configuration:
    source ~/.zshrc
    

Linux

Manual Installation

  1. Download the latest binary-only (bin) distribution ZIP from the Gradle releases page.
  2. 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, replacing x.y.z with 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 running cd ~/Downloads in your terminal. The following commands will create a directory called gradle in 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
    
  3. Configure your system environment by updating your PATH and setting GRADLE_HOME. Add the following to your ~/.bashrc:
    export GRADLE_HOME=/opt/gradle/gradle-x.y.z
    export PATH=$GRADLE_HOME/bin:$PATH
    
  4. Reload your shell configuration:
    source ~/.bashrc
    

Windows

Manual Installation

  1. Download the latest binary-only (bin) distribution ZIP from the Gradle releases page.
  2. Create a new directory C:\Gradle using File Explorer.
  3. Extract the contents of the ZIP archive into C:\Gradle (e.g., resulting in C:\Gradle\gradle-x.y.z).
  4. Configure your system environment by adding the path to your system variables:
  5. In File Explorer, right-click on This PC (or Computer), then click PropertiesAdvanced System SettingsEnvironment Variables.
  6. Under System Variables, click New to create a new variable:
    • Variable name: GRADLE_HOME
    • Variable value: C:\Gradle\gradle-x.y.z
  7. Still under System Variables, locate the Path variable, select it, and click Edit.
  8. Add a new entry for %GRADLE_HOME%\bin (or C:\Gradle\gradle-x.y.z\bin).
  9. 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
You should see the Gradle version and environment details printed.