How to install Gradle on CentOS 8

How To Install Gradle On Linux CentOS 8

On this article we will discuss how to install Gradle 6.8 on CentOS 8.


Gradle is a open-source build tool automation system used primarily for Java projects. It combines the best features of Apache Ant and Apache Maven. Gradle uses a Groovy-based domain-specific language instead of the XML form used by Maven for declaring the project configuration. Gradle supports incremental builds and designed for multi-project builds. Gradle initial relealsed on 2007 or about 14 years ago, and the last stable release on January 8, 2021 with Gradle version 6.8.

On this article we will discuss how to install Gradle on Linux CentOS 8 operating system. Whe will use Gradle version 6.8 as our source for this tutorial. The Gradle installation will be consist of several steps as described below.

  • Prerequisite
  • Download and Extract Gradle package
  • Setup Environment Variable
  • Verify the Gradle installation


Gradle installation needs several prerequisites, then we have to check its requirement first. We need sufficient space for Gradle binnary files and also root account or and account with sudo privilege. Gradle requires Java JDK or JRE version 7 or above to be installed on the system.

Before continuing to the next step, just ensure our Java installed on the system. And if we have no Java installed yet, just install it. Java installation on CentOS article can be found on : How To Install Java (OpenJDK 11) On CentOS 8.

[ramans@otodiginet ~]$ java -version 
openjdk version "" 2020-11-04 LTS 
OpenJDK Runtime Environment 18.9 (build 
OpenJDK 64-Bit Server VM 18.9 (build, mixed mode, sharing)
java version on centos 8

Download and Extract Gradle Package

After all prerequisite are met, then we will download and extract Gradle package file from the official source. On this article we will be using Gradle version 6.8. and /home/ramans directory as a destination. We will submit the command line : wget

[ramans@otodiginet ~]$ wget
 --2021-01-21 16:38:08--
 Resolving (…,, 2606:4700::6812:bf09, …
 Connecting to (||:443… connected.
 HTTP request sent, awaiting response… 301 Moved Permanently
 Location: [following]
 --2021-01-21 16:38:08--
 Resolving (…,, 2606:4700::6811:a014, …
 Connecting to (||:443… connected.
 HTTP request sent, awaiting response… 200 OK
 Length: 150596628 (144M) [application/zip]
 Saving to: ‘’          100%[==========================================>] 143.62M  1.02MB/s    in 6m 8s   
 2021-01-21 16:44:17 (400 KB/s) - ‘’ saved [150596628/150596628]
Download Gradle 6.8 package
Download Gradle 6.8 package

Then we will extract it to the /opt/gradle directory.

[ramans@otodiginet ~]$ sudo unzip -d /opt/gradle
Extract Gradle 6.8 package
Extract Gradle 6.8 Package

Setup Environment Variable

After Gradle package were extracted then we will setup the environment variable of Gradle 6.8. This task could be done by creating a file /etc/profile.d/ with the following entries :

 [ramans@otodiginet ~]$ sudo vi /etc/profile.d/

 export GRADLE_HOME=/opt/gradle/gradle-6.8
 export PATH=${GRADLE_HOME}/bin:${PATH}
Gradle 6.8 Environment variable
Gradle 6.8 Environment variable

Then we make the file by submitting commane line :

 [root@otodiginet ~]# chmod +x /etc/profile.d/
 [root@otodiginet ~]# source /etc/profile.d/
Make Gradle file
Make Gradle file

Verify the Gradle installation

After all installation processes were done, then we will verfity the Gradle 6.8 installation by querying its version. This task will use the command line : gradle -v as shown below :

[root@otodiginet ~]# gradle -v
 Welcome to Gradle 6.8!
 Here are the highlights of this release:
 Faster Kotlin DSL script compilation
 Vendor selection for Java toolchains
 Convenient execution of tasks in composite builds
 Consistent dependency resolution 
 For more details see
 Gradle 6.8
 Build time:   2021-01-08 16:38:46 UTC
 Revision:     b7e82460c5373e194fb478a998c4fcfe7da53a7e
 Kotlin:       1.4.20
 Groovy:       2.5.12
 Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
 JVM: (Red Hat, Inc.
 OS:           Linux 4.18.0-193.el8.x86_64 amd64 
Gradle version 6.8
Gradle version 6.8


On this article we have tried to install Gradle 6.8 on Linux CentOS 8 operating system. The installation was quite done successfully. For more resource about Gradle 6.8 can be found on Gradle official web site.

Share this article via :

Leave a Reply

Your email address will not be published. Required fields are marked *