Open In App

How to Install Gradle on Windows?

Last Updated : 31 Oct, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Gradle is a flexible build automation tool to build software. It is open-source, and also capable of building almost any type of software. A build automation tool automates the build process of applications. The Software building process includes compiling, linking, and packaging the code, etc. Gradle makes the build process more consistent. Using Gradle we can build Android, Java, Groovy, Kotlin JVM, Scala, C++, Swift Libraries, and Applications.  

Prerequisites to Install Gradle

To install Gradle, we have to make sure that we have Java JDK version 8 or higher to be installed on our operating system because Gradle runs on major operating systems only Java Development Kit version 8 or higher. To confirm that we have JDK installed on our system. The ‘Java -version‘ command is used to verify if you run it on a windows machine.

Verify JDK installation

 

You should see output like in the above image it confirms that you have JDK installed and the JAVA_HOME path set properly if you don’t have JDK Install. then you should install it first before going to the next step. in this tutorial, we are not cover the installation of JDK. we consider that we have JDK already on the system.  

Installing Gradle Manually

Gradle Enterprise provides the installation of Gradle with package manager SDKMAN! but here we are covering the manual installation of Gradle for Microsoft windows machines.  before starting we confirmed we have JDK installed properly on the machine.

Step 1. Download the latest Gradle distribution

To install Gradle we need the Gradle distribution ZIP file, we can download the latest version of Gradle from the official website. there are other versions of Gradle available but we will strongly suggest using the official. The current release of Gradle is version 7.5.1, released on 05 Aug 2022. it might be another latest release available when you read this article. Always download the latest version. The Gradle distribution zip file is available in two flavors:

  1. Binary-only: Binary version contains only executable files no source code and documentation. You can browse docs, and sources online.
  2. Complete, with docs and sources: This package contains docs and sources offline. I recommend going with binary-only. 

Step 2. Unpack the  Gradle distribution zip file

After successfully downloading the Gradle distribution ZIP file, we need to unzip/unpack the compressed file. In File Explorer, create a new directory C:\Gradle (you can choose any path according to your choice) as shown In the image.

 

Now unpack the Gradle distribution ZIP into C:\Gradle using an archiver tool of your choice.

Gradle distribution after extracted

 

Step 3. Configure your system environment

We have successfully unzipped the Gradle distribution Zip file. Now set the System environment PATH variable to the bin directory of the unzipped distribution. We have extracted files in the following location. you can choose any location to unzip: 

C:\Gradle\bin

To set the Environment variable, Right-click on the “This Pc /Computer” icon, then select Properties -> Advanced System  Settings -> Environmental Variables. The following screenshot may help you.

System Properties

 

As shown in the following image, In the section System Variables select Path, then select the Edit option.

Select the path for edit

 

You will now see the following screen Select New, then add an entry for C:\Gradle\bin as shown in the image, now click on the OK button to save changes.

Add new Path

 

Step 4. Verifying and confirming the installation

After the successful setting of the environment variable, now it’s time to verify the installation. Run the “gradle -v” command on the Windows command prompt, which displays the details of the Gradle version installed on the PC. If you get similar output as in the image, Gradle has been installed successfully, and you can now use Gradle in your projects.

Verifying and confirming the installation

 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads