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_HOMEset (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:
java -version
javac -versionBoth should report 21. If not, fix Java before continuing—Gradle uses whatever JDK JAVA_HOME points to.
echo %JAVA_HOME%Example expected value:
C:\Program Files\Eclipse Adoptium\jdk-21.0.6.7-hotspotChoose an Installation Method
| Method | Best for |
|---|---|
| Binary ZIP (official) | Full control, matches docs everywhere |
| Scoop | Developers already using Scoop |
| Chocolatey | Windows 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.
Option A: Official Binary ZIP (Recommended)
Step 1: Download Gradle
- Open https://gradle.org/releases/
- 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:
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
- Press
Win + S, search Environment Variables, open Edit the system environment variables - Click Environment Variables…
- Under System variables, click New:
| Variable name | Variable value |
|---|---|
GRADLE_HOME | D:\tools\gradle\gradle-8.12.1 |
- Edit Path, add:
%GRADLE_HOME%\bin- Confirm all dialogs and open a new terminal
Step 4: Verify
gradle -versionExpected 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
# Install Scoop first if needed: see get.scoop.sh
scoop install gradleOpen a new terminal:
gradle -versionScoop manages PATH; you may still set JAVA_HOME for JDK 21 manually.
Option C: Chocolatey
Run PowerShell as Administrator:
choco install gradle -yVerify in a new window:
gradle -versionGenerate Wrapper in a New Folder (Preview)
Once gradle works globally, you can create Wrapper scripts for a team:
mkdir hello-gradle
cd hello-gradle
gradle wrapper --gradle-version 8.12.1
dirYou should see gradlew, gradlew.bat, and gradle\wrapper\. Teammates then run:
gradlew.bat -versionWrapper details come in a dedicated chapter; this confirms your install can bootstrap projects.
Common Windows Issues
| Symptom | Cause | Fix |
|---|---|---|
gradle is not recognized | PATH not updated | New terminal; check %GRADLE_HOME%\bin on Path |
| Wrong Java version | JAVA_HOME points elsewhere | Set JAVA_HOME to JDK 21 root; reopen terminal |
JAVA_HOME is not set | Installer skipped Java config | Set manually per Java Windows chapter |
| Access denied extracting ZIP | Protected folder | Extract to D:\tools or user Downloads first |
| Corporate proxy failures | Gradle cannot download | Configure proxy in gradle.properties (advanced) |
Uninstall or Upgrade
| Action | Steps |
|---|---|
| Uninstall | Delete Gradle folder; remove GRADLE_HOME and Path entry |
| Upgrade | Download 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.