Install Gradle on Windows

Introduction

This chapter installs Gradle on Windows so you can run gradle from any terminal and bootstrap new projects. You need JDK 21 first—Gradle is a Java application. In real teams you will spend most of your time on gradlew (the Wrapper); a global install is still useful for gradle init and generating Wrapper files.

Prerequisites

  • Windows 10 or Windows 11
  • JDK 21 installed and JAVA_HOME set (Windows Java install)
  • Administrator rights recommended for system-wide PATH
  • Stable internet connection

JDK Check Before Gradle

Open a new PowerShell or Command Prompt window:

bash
java -version
javac -version

Both should report 21. If not, fix Java before continuing—Gradle uses whatever JDK JAVA_HOME points to.

bash
echo %JAVA_HOME%

Example expected value:

text
C:\Program Files\Eclipse Adoptium\jdk-21.0.6.7-hotspot

Choose an Installation Method

MethodBest for
Binary ZIP (official)Full control, matches docs everywhere
ScoopDevelopers already using Scoop
ChocolateyWindows package workflow teams

Tip

Wrapper-First Mindset

After installation, prefer gradlew inside each project. The global gradle command is mainly for creating projects and upgrading the Wrapper.

Step 1: Download Gradle

  1. Open https://gradle.org/releases/
  2. Download the binary-only ZIP for the latest 8.x release (e.g. gradle-8.12.1-bin.zip)

Use the -bin archive, not -all, unless you want offline documentation bundled.

Step 2: Extract to a Permanent Folder

Extract to a tools path outside C:\Program Files, for example:

text
D:\tools\gradle\gradle-8.12.1\
  bin\
  lib\
  ...

Avoid spaces in the path when possible (D:\tools\gradle\... is fine).

Step 3: Set Environment Variables

  1. Press Win + S, search Environment Variables, open Edit the system environment variables
  2. Click Environment Variables…
  3. Under System variables, click New:
Variable nameVariable value
GRADLE_HOMED:\tools\gradle\gradle-8.12.1
  1. Edit Path, add:
text
%GRADLE_HOME%\bin
  1. Confirm all dialogs and open a new terminal

Step 4: Verify

bash
gradle -version

Expected output includes:

  • Gradle version (8.x)
  • Launcher JVM / Daemon JVM showing 21
  • OS Windows

Warning

If Java version is not 21, fix JAVA_HOME—not Gradle. Gradle does not ship its own JDK for running the build tool itself.

Option B: Scoop

powershell
# Install Scoop first if needed: see get.scoop.sh
scoop install gradle

Open a new terminal:

bash
gradle -version

Scoop manages PATH; you may still set JAVA_HOME for JDK 21 manually.

Option C: Chocolatey

Run PowerShell as Administrator:

powershell
choco install gradle -y

Verify in a new window:

bash
gradle -version

Generate Wrapper in a New Folder (Preview)

Once gradle works globally, you can create Wrapper scripts for a team:

bash
mkdir hello-gradle
cd hello-gradle
gradle wrapper --gradle-version 8.12.1
dir

You should see gradlew, gradlew.bat, and gradle\wrapper\. Teammates then run:

bash
gradlew.bat -version

Wrapper details come in a dedicated chapter; this confirms your install can bootstrap projects.

Common Windows Issues

SymptomCauseFix
gradle is not recognizedPATH not updatedNew terminal; check %GRADLE_HOME%\bin on Path
Wrong Java versionJAVA_HOME points elsewhereSet JAVA_HOME to JDK 21 root; reopen terminal
JAVA_HOME is not setInstaller skipped Java configSet manually per Java Windows chapter
Access denied extracting ZIPProtected folderExtract to D:\tools or user Downloads first
Corporate proxy failuresGradle cannot downloadConfigure proxy in gradle.properties (advanced)

Uninstall or Upgrade

ActionSteps
UninstallDelete Gradle folder; remove GRADLE_HOME and Path entry
UpgradeDownload new ZIP, update GRADLE_HOME to new folder, new terminal

Projects using Wrapper keep their own Gradle version until you run gradle wrapper --gradle-version ... in that repo.

FAQ

Do I need Gradle if IntelliJ builds my project?

Yes for CI and reproducibility. IntelliJ can import Gradle projects, but ./gradlew is what servers run. We configure IDEA in a later chapter.

Is Gradle the same as the JDK?

No. Gradle is a build tool that runs on the JDK. You need both.

Can I install only Wrapper without global Gradle?

On an existing repo, clone and run gradlew.bat—no global install. To create Wrapper from scratch, you typically need gradle once locally.

Which Gradle version should I use?

Use current 8.x stable for new learning. Match your team’s Wrapper version in real projects.

What comes next?

Install Gradle on macOS, or skip ahead if you are on Windows only—then Linux install for other machines.