Gradle Build Tool: Install Gradle on Ubuntu 16.10

Gradle is a free and open source build automation toolset based on the concepts of Apache Ant and Apache Maven. Gradle provides a platform to support the entire development lifecycle of a software project.

Official Website:  https://gradle.org

 

1. Prerequisites

Gradle requires Java 7 or new version. You can check by issue command:

 

2. Download Gradle

Gradle distribution archive comes in two types: “binary-only” and “complete”. The “binary-only” archive contains the Gradle software only wheres “complete” archive comes with binary, documentation and source. Run the following command to download Gradle to your system.

wget https://services.gradle.org/distributions/gradle-3.5-all.zip

 

3. Unpack Gradle

unzip gradle-3.5-all.zip

Next, we will move gradle-3.5 to ~/opt/gradle directory

sudo mv gradle-3.5/ ~/opt/gradle

 

4. Create GRADLE_HOME Environment Variables

Open your .profile file in vi, emacs, or gedit.

sudo nano ~/.profile

Paste the following at the bottom of your .profile file.

# Gradle
if [ -d "/opt/gradle" ]; then
    export GRADLE_HOME="/opt/gradle"
    PATH="$PATH:$GRADLE_HOME/bin"
fi

Save the file.

We will need to activate the above environment variables. We can do that by log out and log in again or simply run below command:

source ~/.profile

 

5. Verify

To check if Gradle is properly installed, we just need type:

Leave a Reply