• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install Gradle on Ubuntu 18.04

Written by Rahul, Updated on April 11, 2020

Gradle is an open-source build tool for the automation of applications. The Gradle helps developers team to build, automate and deliver software easier and faster. This tutorial will help you to install Gradle on Ubuntu 18.04 LTS and 16.04 LTS system.

You may like:

  • How to Install Apache Maven on Ubuntu 18.04

Prerequisites

Gradle requires to run Java JDK 8 or JRE 8 or higher version. Make sure you have java installed on your Ubuntu system or use following command to install it.

sudo apt install openjdk-11-jdk

Verify installed Java version on your system.

java -version

openjdk 11.0.6 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, mixed mode, sharing)

Install Gradle on Ubuntu

Once you installed Java on your system. Download the latest Gradle distribution release binary file from its official download page.

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

Then extract the downloaded archive and place it to the proper location. Generally, I used /usr/local directory for storing applications. You can use alternative directory like /opt.

unzip gradle-6.3-bin.zip
mv gradle-6.3 /usr/local/gradle

Gradle has been configured on your system.

Setup Environment Variable

Now, you need to setup Gradle with PATH environment variable, Also make sure the variable is set after system reboot.

Place a shell script under profile.d directory to set PATH variable on reboot. Create a file like below:

vim /etc/profile.d/gradle.sh

and add the below line to file

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

Save file and close it. Now source the script to apply environment for current shell.

source /etc/profile.d/gradle.sh

And you have done the Grandle installation on Ubuntu system.

Test Gradle Version

Once you finished the Gradle installation, let’s check the installed version on your system.

gradle -v

Output

Welcome to Gradle 6.3!

Here are the highlights of this release:
 - Java 14 support
 - Improved error messages for unexpected failures

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

------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------

Build time:   2020-03-24 19:52:07 UTC
Revision:     bacd40b727b0130eeac8855ae3f9fd9a0b207c60

Kotlin:       1.3.70
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          14 (Oracle Corporation 14+36-1461)
OS:           Linux 4.15.0-66-generic amd64

If you see the results like above, means Gradle is successfully installed and configured on your Ubuntu system.

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Ubuntu 20.04 5
  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
  • How To Install NVM on macOS with Homebrew 0
  • How to Install .NET Core on Debian 10 0
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy