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.
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.
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.
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.
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.
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).
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
