Gradle - How to install Gradle on Window

Posted on October 29, 2016


In this tutorial we will show you how to install Gradle on Window.

Prerequisites 

  •  JDK or JRE (version 7 or higher)
  • Window 7, Window 8 or Window 10

To check java version on Window system, enter  java –version  in command prompt.

C:\Users>java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

 

Installation Instructions

  • Download the latest release of Gradle from https://gradle.org/gradle-download . A gradle binary distribution comes packaged as .zip.
  • Unzip the zip file in a folder. Gradle distribution structure is shown below.

gradle-directory-struc.png

  • To run gradle, add environment variable GRADLE_HOME.
  • To add environment variable, right click on My Computer→Properties→Advanced System Settings→Environment variable.

gradle-environment-variable-win.png 

  • In Environment Variable window click on New button and enter the variable name as GRADLE_HOME and variable value as location of bin folder of Gradle.

gradle-environment-variable-win2.png

  • Now add Gradle path to PATH environment variable, so select PATH variable and click on Edit button under User variable. 

gradle-environment-edit-variable-win.png

  • In Edit environment variable window, click on New  button and enter new value as  %GRADLE_HOME%\bin. Then press OK

 

Running and Testing installation

  • To run Gradle, type the gradle in window command prompt.
  • To check version of Gradle, type gradle -v in window command prompt.
C:\Users>gradle -v

------------------------------------------------------------
Gradle 3.1
------------------------------------------------------------

Build time:   2016-09-19 10:53:53 UTC
Revision:     13f38ba699afd86d7cdc4ed8fd7dd3960c0b1f97

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_71 (Oracle Corporation 25.71-b15)
OS:           Windows 10 10.0 amd64