How to Download and Install Gradle 4.1 on Windows

2 minute read

download install gradle 4.1 windows

Do you need to download and install Gradle 4.1 on Windows?

You’ve reached the right place.

Because in this tutorial I’ll walk you through the different setup steps.

Off we go!

Check following post if you are looking to download and install Gradle 3.5 or the latest Gradle version.

What is Gradle?

Gradle is a build automation tool. It helps you to build, automate and deliver software.

Gradle is open-source and licensed under the Apache License 2.0.

Step #1: Check Prerequisites

Gradle requires Java to work. So let’s check if you have Java configured on your system.

Click on the search button. Then type “cmd” (without quotes).

On Windows 7 click on the Windows button.

Click on the Command Prompt shortcut.

windows search cmd

Wait for the command prompt to open.

Type “java -version” and press ENTER.

java version command

The above command prints the installed Java version.

java installed version

For Gradle 4.1 you need Java version 1.7 or higher.

If you do not have Java installed on your system. Check following post which details how to install a JDK on Windows 10.

Step #2: Download

Go to the Gradle releases page.

gradle releases page

Scroll down to v4.1 and click on the binary-only link.

gradle 4-1 release

Wait for the download to complete.

Do you want to skip above steps? Here is the direct link to download the Gradle 4.1 binary-only installer for Windows.

Step #3: Install

Open the location of the downloaded installer.

gradle 4-1 downloaded installer

Right-click the ZIP archive file. Select Extract All….

gradle 4-1 downloaded installer extract all

Select an extract destination for the Gradle files.

In this example, we extract in C:\Users\Downlinko\tools\gradle.

gradle tools extract destination

Click on Extract. This extracts all Gradle files under C:\Users\Downlinko\tools\gradle\gradle-4-1.

From now on we refer to this location as [GRADLE_INSTALL_DIR].

gradle 4-1 install dir

Step #4: Setup

We need to set up an environment variable that will point to our Gradle installation.

Click on the search button. Then type “env”.

On Windows 7 click on the Windows button.

Click on the Edit environment variables for your account shortcut.

windows search env

Wait for the environment variables window to open.

Click on New….

windows account environment variables jdk new

Enter “GRADLE_HOME” as variable name. Enter the [GRADLE_INSTALL_DIR] as variable value.

In this tutorial the installation directory is: C:\Users\Downlinko\tools\gradle\gradle-4.1.

Click OK.

gradle 4-1 home variable

Next, we need to configure the PATH environment variable so we can run Gradle from a command prompt.

Select the PATH variable. Click on Edit….

gradle 4-1 edit path variable

Click on New and type “%GRADLE_HOME%\bin” as shown below.

Click OK.

gradle path variable

Click OK once more to close the environment variables window.

gradle 4-1 windows account environment variables

On Windows 7 you cannot add extra values for an existing Path variable. You need to append “;%GRADLE_HOME%\bin” at the end of the variable value instead.

Step #5: Test

To test the setup click on the search button. Then type “cmd”.

Click on the Command Prompt shortcut.

windows search cmd

Wait for the command prompt to open.

Type “gradle -version” and press ENTER.

gradle version command

The above command prints the installed Gradle version.

gradle 4-1 version output

Congratulations, you have installed Gradle 4.1 on Windows 10!

Now go ahead and create your first Gradle build.

Drop a line below if you liked this post.

Thanks!

Leave a comment