Gradle is an open-source build automation tool focused on flexibility and performances. It builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven for declaring the project configuration.

Gradle was designed for multi-project builds, which can grow to be quite large. It supports incremental builds by intelligently determining which parts of the build tree are up to date; any task dependent only on those parts does not need to be re-executed. Below are some of the best features of Gradle:

  • Highly customizable — Gradle is modelled in a way that customizable and extensible in the most fundamental ways.

  • Fast — Gradle completes tasks quickly by reusing outputs from previous executions, processing only inputs that changed, and executing tasks in parallel.

  • Powerful — Gradle is the official build tool for Android, and comes with support for many popular languages and technologies.

To install Gradle on CentOS 7, you can follow the guide here

In this guide, we will explain how to install Gradle on an Ubuntu 16.04 server.

Deploying your cloud server
If you have not already registered with Cloudwafer, you should begin by getting signed up. Take a moment to create an account after which you can easily deploy your own cloud servers.

Once you have signed up, log into your Cloudwafer Client Area and deploy your Cloudwafer cloud server.

Prerequisites: Gradle requires a Java JDK version 7 or higher to run. You can check here on how to install Java on Ubuntu 16.04 if you don't have it installed. To check the version of Java that is currently set as the default, issue the command below:

java -version

Step 1: Download and install Gradle
As at the time of writing this guide, the current Gradle release is version 5.0, released on 26 Nov 2018. The distribution zip file comes in two flavours: Binary-only and Complete (all with docs and sources). We are going to download and install the Binary-only flavour for the purpose of this guide.


Step 2: Unpack the distribution

  • Create a directory for the Gradle installation

    sudo mkdir /opt/gradle
  • Extract the downloaded archive to the newly created directory.

     unzip -d /opt/gradle

  • You can view the contents of the directory using the command below:

    ls /opt/gradle/gradle-5.0

Step 3: Configure your system environment
For running Gradle, firstly add the environment variable GRADLE_HOME. This should point to the unpacked files from the Gradle website (the directory of the unzipped distribution)

export PATH=$PATH:/opt/gradle/gradle-5.0/bin

This is done in order for Gradle to be executable anywhere on the system.

Step 4: Verifying installation
Issue the command below to run Gradle and display the version

gradle -v

You have successfully completed the Gradle installation.