How to Install and Configure Gradle on Windows and IntelliJ IDEA, Including Custom Jar Location

This guide walks through downloading Gradle 6.6.1, setting GRADLE_HOME and PATH on Windows, configuring a custom GRADLE_USER_HOME for dependency jars, and adjusting IntelliJ IDEA settings to use the installed Gradle distribution and a specific JDK.

The Dominant Programmer
The Dominant Programmer
The Dominant Programmer
How to Install and Configure Gradle on Windows and IntelliJ IDEA, Including Custom Jar Location

Scenario

Gradle is an open‑source project automation tool that builds on concepts from Apache Ant and Maven. It uses a Groovy‑based DSL instead of XML and currently supports Java, Groovy, and Scala.

Installation

Download the required Gradle distribution (e.g., 6.6.1 full distribution) from https://gradle.org/releases/.

Unzip the archive to a directory, for example C:\gradle-6.6.1.

Create a system environment variable GRADLE_HOME whose value is the unzip path.

Add %GRADLE_HOME%\bin to the system Path variable.

Open a command prompt and run gradle -v to verify the installation.

Gradle download page
Gradle download page
Unzipped Gradle directory
Unzipped Gradle directory
Setting GRADLE_HOME
Setting GRADLE_HOME
Adding %GRADLE_HOME%\\bin to Path
Adding %GRADLE_HOME%\\bin to Path
gradle -v output
gradle -v output

Customizing the dependency cache location

Create a system environment variable GRADLE_USER_HOME and set it to the directory where you want Gradle to store downloaded JAR files.

Setting GRADLE_USER_HOME
Setting GRADLE_USER_HOME

IDEA configuration

Open File → Settings → Build, Execution, Deployment → Gradle in IntelliJ IDEA.

Set “Gradle user home” to the directory defined by GRADLE_USER_HOME.

Enable “Use auto‑import”.

Select “Use local Gradle distribution” and browse to the previously installed Gradle directory.

Set the JDK to the local JDK you wish to use.

IDEA Gradle settings
IDEA Gradle settings
Gradle user home path in IDEA
Gradle user home path in IDEA

Creating a new Gradle project

Choose File → New → Project → Gradle .

Select the JDK, click Next, and fill in the project coordinates (group, artifact, version) similar to a Maven project.

Finish the wizard; the generated project contains a build.gradle file that manages dependencies and plugins.

The default build.gradle includes a JUnit dependency.

New Gradle project wizard
New Gradle project wizard
Project coordinates screen
Project coordinates screen
Generated project structure with JUnit dependency
Generated project structure with JUnit dependency

Resulting project structure

The project directory mirrors a Maven layout, with build.gradle serving the role of pom.xml. The dependency cache resides in the directory specified by GRADLE_USER_HOME (default C:\Users\admin6\.gradle if not changed).

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

GradleIntelliJ IDEAWindowsJava buildenvironment variablescustom jar location
The Dominant Programmer
Written by

The Dominant Programmer

Resources and tutorials for programmers' advanced learning journey. Advanced tracks in Java, Python, and C#. Blog: https://blog.csdn.net/badao_liumang_qizhi

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.