How to Install Gradle on Windows 11

Gradle is a powerful build automation tool used primarily for Java projects, but it also supports other languages. Installing Gradle on Windows 11 involves several steps, including downloading the Gradle distribution, setting up the environment variables, and verifying the installation. This guide will walk you through each step in detail.

Step 1: Download Gradle

  1. Visit the Gradle Releases page.
  2. Click on the "Binary-only" link to download the latest version of Gradle. The distribution will be downloaded as a ZIP file.

Step 2: Extract the ZIP File

  1. Once the download is complete, locate the ZIP file in your Downloads folder.
  2. Right-click on the ZIP file and select "Extract All..." to extract its contents.
  3. Choose a destination folder for the extracted files. For example, you might choose C:\Gradle.

Step 3: Set Up Environment Variables

To use Gradle from the command line, you need to set up the GRADLE_HOME environment variable and add Gradle's bin directory to your PATH.

  1. Open Environment Variables:

    • Press Win + X and select "System".
    • Click on "Advanced system settings" on the left.
    • In the System Properties window, click on the "Environment Variables..." button.
  2. Create GRADLE_HOME Variable:

    • In the Environment Variables window, click "New..." under the "System variables" section.
    • Enter GRADLE_HOME as the variable name.
    • Enter the path to the Gradle folder (e.g., C:\Gradle\gradle-<version>) as the variable value.
    • Click "OK".
  3. Update PATH Variable:

    • In the Environment Variables window, find the Path variable under the "System variables" section and select it.
    • Click "Edit...".
    • Click "New" and add the path to the Gradle bin directory (e.g., C:\Gradle\gradle-<version>\bin).
    • Click "OK" to close all dialog boxes.

Step 4: Verify the Installation

  1. Open a new Command Prompt window to ensure the environment variables are refreshed.
  2. Type gradle -v and press Enter.

You should see an output that displays the Gradle version and other related information, indicating that Gradle is successfully installed.

------------------------------------------------------------
Gradle 7.x.x
------------------------------------------------------------

Build time:   yyyy-MM-dd HH:mm:ss UTC
Revision:     xxxxxxxxxxxxxxxxxxxxxx

Kotlin:       1.x.x
Groovy:       3.x.x
Ant:          Apache Ant(x.x.x)
JVM:          x.x.x (Oracle Corporation x.x.x)
OS:           Windows 11 xxxxx amd64

Conclusion

You have now successfully installed Gradle on Windows 11. With Gradle installed, you can start building and managing your projects more efficiently. For more information on using Gradle, check out the official Gradle documentation.

If you encounter any issues or have any questions, feel free to ask in the comments below. Happy building!

Comments