How To install Grandle on Ubuntu 20.10

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

In this tutorial, we will install the latest Gradle on Ubuntu 20.10.

Update the system

sudo apt-get update
sudo apt-get -y upgrade

Install JDK

Gradle requires Java Development Kit (JDK) 7 or higher. In this tutorial, we will be installing JDK 8.

sudo apt-get -y install openjdk-8-jdk wget unzip

The above command will also install wget and unzip. Check the installation.

java -version

You will see the following result:

openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.10.2-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)

Download Gradle

The redistributable Gradle archive is of two types: binary only and full. The “binary only” archive contains Gradle software only where the “full” archive comes with binaries, documentation, and source code. To run the following command which is described below to load Gragle on your system:

wget https://services.gradle.org/distributions/gradle-3.4.1-bin.zip

Install Gradle

Create a directory for your Gradle installation.

sudo mkdir /opt/gradle

Unpack the downloaded archive into the newly created directory.

sudo unzip -d /opt/gradle gradle-3.4.1-bin.zip

Set your PATH environment variable so that the gradle executable can run directly anywhere on the system.

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

You can run the following command to check if the Gradle installation was successful.

gradle -v

You should see the following result:

------------------------------------------------------------
Gradle 3.4.1
------------------------------------------------------------

Build time:   2017-03-03 19:45:41 UTC
Revision:     9eb76efdd3d034dc506c719dac2955efb5ff9a93

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_121 (Oracle Corporation 25.121-b13)
OS:           Linux 4.8.0-41-generic amd64

Installation is completed!

Was this article helpful?

Related Articles

Leave A Comment?