How to Install Gradle on ubuntu 20.04 LTS.

Gradle is a tool used to build, automate, and deliver software. Gradle is a object-oriented programming language & used for Java & C++ project to define build scripts. It helps programmers team to build, automate and deliver software easier and faster which increased their productivity.

Install Gradle on ubuntu

Update the system

apt-get update

Install Java

apt-get install default-jdk

Check Java version.

java -version

Here is the command output.

openjdk version "11.0.11" 
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

Download Gradle zip file.

wget https://downloads.gradle-dn.com/distributions/gradle-6.5.1-bin.zip

Extract the downloaded zip file.

unzip gradle-6.5.1-bin.zip

Change the location of downloaded gradle folder to /usr/local/gradle.

mkdir /usr/local/gradle
&
mv gradle-6.5.1 /usr/local/gradle

Set the Environment Variable.

Open the file.

vim /etc/profile.d/gradle.sh

Add the following lines.

export PATH=/usr/local/gradle/bin:$PATH

Give the execute permission.

chmod +x /etc/profile.d/gradle.sh

Run source command  to apply environment.

source /etc/profile.d/gradle.sh

Check Gradle version.

gradle -v

Here is the command output.

Welcome to Gradle 6.5.1!

Here are the highlights of this release:
 - Experimental file-system watching
 - Improved version ordering
 - New samples

For more details see https://docs.gradle.org/6.5.1/release-notes.html


------------------------------------------------------------
Gradle 6.5.1
------------------------------------------------------------

Build time:   2021-01-10 06:32:47 UTC
Revision:     66bc713f7169626a7f0134bf452abde51550ea0a

Kotlin:       1.3.72
Groovy:       2.5.11
Ant:          Apache Ant(TM) version 1.10.7 compiled 
JVM:          11.0.7 (Ubuntu 11.0.7+10-post-Ubuntu-3ubuntu1)
OS:           Linux 5.4.0-26-generic amd64

 

Leave a Reply