How to install Gradle on CentOS 8

Gradle is a powerful and flexible build tool, mainly used for Java projects, combining the advantages of Ant and Maven. Unlike other preprocessing tools that use XML, Gradle uses Groovy, a dynamic, object-oriented Java platform language for defining projects and build scripts.

This article explains how to install Gradle on CentOS 8. We will download the latest version of Gradle from their official website.

1. Prerequisites##

The following instructions assume that you have logged into the system as root or another user with sudo privileges.

Two, install OpenJDK

Gradle installs Java SE 8 or newer on the server.

Enter the following command to install the OpenJDK package:

sudo yum install java-1.8.0-openjdk-devel

Verify the Java installation by printing the Java version number:

java -version

The output should look like this:

openjdk version "11.0.6"2020-01-14 LTS
OpenJDK Runtime Environment 18.9(build 11.0.6+10-LTS)
OpenJDK 64-Bit Server VM 18.9(build 11.0.6+10-LTS, mixed mode, sharing)

Three, download Gradle

At the time of writing, the latest version of Gradle is 6.3. Before proceeding to the next step, you should check Gradle Release Page to see if there is a newer version available.

Use the wget command to download the Gradle binary file to the /tmp folder:

wget https://services.gradle.org/distributions/gradle-6.3-bin.zip -P /tmp

Once the download is complete, unzip the file to the /opt/gradle folder:

sudo unzip -d /opt/gradle /tmp/gradle-*.zip
If you get an error message saying`sudo: unzip: command not found`,use`sudo dnf install unzip`Install the unzip package.

Verify that Gradle has been decompressed:

ls /opt/gradle/gradle-*

The output is as follows:

bin  init.d  lib  LICENSE  NOTICE  README

Fourth, set environment variables##

Next, we will configure the PATH environment variable to include Gradle's bin directory. To do this, open your file editor and create a file named gradle.sh in the /etc/profile.d directory:

sudo nano /etc/profile.d/gradle.sh

Copy and paste the following code:

export GRADLE_HOME=/opt/gradle/gradle-6.3export PATH=${GRADLE_HOME}/bin:${PATH}

Save and close the file. The script will be effective the next time the shell is started.

Make the script executable by triggering the following chmod command:

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

Use the source command to load environment variables:

source /etc/profile.d/gradle.sh

Five, verify the Gradle installation##

To verify whether Gradle is installed correctly, run the following command, the Gradle version will be displayed:

gradle -v

You can see information similar to the following:

Welcome to Gradle 6.3!

Here are the highlights ofthis 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-2419:52:07 UTC
Revision:     bacd40b727b0130eeac8855ae3f9fd9a0b207c60

Kotlin:1.3.70
Groovy:2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 12019
JVM:11.0.6(Oracle Corporation 11.0.6+10-LTS)
OS:           Linux 4.18.0-80.11.2.el8_0.x86_64 amd64

that's it. You have installed the latest Gradle on your CentOS system, and you can start using it.

Six, summary##

We have shown you how to install Gradle on CentOS 8.

You can now browse Gradle official documentation page and learn Gradle Quick Start.

Recommended Posts

How to install Gradle on CentOS 8
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
How to install Memcached on CentOS 8
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install Virtualbox on CentOS 8
How to install TeamViewer on CentOS 8
How to install Perl 5 on CentOS
How to install Git on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
How to install GCC on CentOS 8
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
How to install Python on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Postgresql on CentOS 8
How to install Wordpress on Centos
How to install htop on CentOS 8
How to install TeamViewer on CentOS 8
How to install MariaDB on CentOS 8
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8
How to install Apache on CentOS 8
How to install OpenCV on CentOS 8
How to install PHP on CentOS 8
How to install MongoDB on CentOS 8
How to install Apache Maven on CentOS 8
How to install Apache Kafka on CentOS 7
[Graphic] How to install tomcat on centos
R&D: How To Install Python 3 on CentOS 7
How to install GCC compiler on CentOS 7
How to install offline JDK1.8 on centos7.0
How to install and configure Elasticsearch on CentOS 7
How to install and use Docker on CentOS 7
How to install RPM packages on CentOS Linux
How to install and configure VNC on CentOS 8
How to install and use Composer on CentOS 8
How to install and configure Redis on CentOS 8
How to install Node.js and npm on CentOS 8
How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
How to install and configure phpMyAdmin on CentOS 6
How to install and use Curl on CentOS 8
How to install and configure Owncloud on CentOS 8
How to install VirtualBox client extension on CentOS 8
How to install Docker CE on RHEL 8 / CentOS 8
How to install and uninstall tomcat on centos
How to install and configure Redmine on CentOS 8
How to install Ruby on Ubuntu 20.04