Gradle Tutorial - How to install Gradle on Windows

The installation instructions for Gradle on their site at http://www.gradle.org/installation is okay for a beginner, but could be better. If you followed the very simple instructions on their site, then you may have run into some trouble and would have to do some searching on the internet to find out why you weren't getting anything from typing gradle -v into the command prompt. Here are the full steps to get Gradle working without worries!


Difficulty - Beginners

It'll be a piece of cake.  This cake is no lie.

Prerequisites

  • Windows 8 (or any Windows version)
  • Java JDK installed

Instructions

  1. Download Gradle at their site: http://www.gradle.org/downloads.
  2. Unzip the package to anywhere you want to keep it.  I normally put these kinds of things in my development directory where other goodies go into also.
  3. Now, right click on "Computer" (a.k.a. "My Computer") and then select "Properties":

gradle-tutorial-1.png

  1. Then click on "Advance system settings":

gradle-tutorial-2.png

  1. Now, you should already be on the "Advanced" tab, so click on "Environment Variables...":

gradle-tutorial-3.png

  1. Then we want to add a new user variable for us called JAVA_HOME.  Click on "New..." as shown below:

gradle-tutorial-4.png

  1. Now enter JAVA_HOME into the input field for "Variable name:":  

gradle-tutorial-5.png

  1. For "Variable value:", we want to enter the location of your Java JDK directory.  The Java JDK on my computer is located in it's default installation location, C:\Program Files\Java\jdk1.8.0_25:  

gradle-tutorial-6.png

  1. When finished, click "OK".
  2. Under "System variables", look for the "Variable" called Path

gradle-tutorial-7-new.png

  1. Now we want to add additional paths to our PATH environment variable, so let's click on "Edit..." under "System variables" as shown below:

gradle-tutorial-8.png

  1. Then proceed to the end of the value and enter the \bin locations of both Gradle and the Java JDK.  

gradle-tutorial-9.png

  1. For Gradle, I entered it as C:\gradle-2.1\bin .  For the Java JDK, enter only %JAVA_HOME%\bin because %JAVA_HOME% will use the user variable we defined earlier to get your Java JDK directory for you.

gradle-tutorial-10.png

  1.  After you're done entering the new bin paths for Gradle and the Java JDK, click "OK".  Click "OK" a couple more times to back out.
  2. Now, let's test it out.  Open up command prompt and type gradle -v and you should see something similar:

gradle-tutorial-11.png