Java Programming

How to Install Gradle on AlmaLinux 8

In this tutorial, we’ll discuss about how to install Gradle on AlmaLinux 8.

Gradle is an open-source build automation tool focused on flexibility and performance. Gradle build scripts are written using a Groovy or Kotlin DSL. Read about Gradle features to learn what is possible with Gradle.

  • Highly customizable — Gradle is modeled in a way that is customizable and extensible in the most fundamental ways.
  • Fast — Gradle completes tasks quickly by reusing outputs from previous executions, processing only inputs that changed, and executing tasks in parallel.
  • Powerful — Gradle is the official build tool for Android, and comes with support for many popular languages and technologies


Let’s get started with the installation.

Install Gradle on AlmaLinux 8

1. Keep the server up to date

# dnf update -y

2. Install OpenJDK 8

# dnf install java-1.8.0-openjdk-devel -y

Verify the Java installation by printing the Java version :

java -version

Output will be similar like:

openjdk version “1.8.0_282”
OpenJDK Runtime Environment (build 1.8.0_282-b08)
OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

3. Download Gradle

At the time of writing this article, the latest version of Gradle is 6.8.1. Before continuing with the next step, you should check the Gradle releases page to see if a newer version is available.

Download the Gradle binary file in the /tmp directory using the following wget command:

# wget -P /tmp

Once the download is completed, unzip the file in the /opt/gradle directory:

# unzip -d /opt/gradle /tmp/gradle-*.zip

4. Configure the environment variables

Next, we’ll create one file named to configure the environmental variable PATH. Create a file in the /etc/profile.d directory. Use your favorite editor. For this demonstration purpose, we are using vi editor.

# vi /etc/profile.d/

Paste the following configuration:

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

Save and exit.

Next, make the script executable by using chmod command like shown below:

# chmod +x /etc/profile.d/

Load the environment variables using the source command :

# source /etc/profile.d/

To validate that Gradle is installed properly run the following command which will display the Gradle version:

# gradle -v

Output will be similar like:

Welcome to Gradle 6.8.1!

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.1

Build time: 2021-01-22 13:20:08 UTC
Revision: 31f14a87d93945024ab7a78de84102a3400fa5b2

Kotlin: 1.4.20
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_282 (Red Hat, Inc. 25.282-b08)
OS: Linux 4.18.0-240.el8.x86_64 amd64

That’s it. The installation has been completed successfully.

In this tutorial, we have seen how to install Gradle on AlmaLinux 8.

Related Articles