How to Install Gradle on AlmaLinux 10

Published: 2026-06-25
Google AdSense 广告位 (待申请通过后开启)

Introduction

Gradle is a modern build automation tool widely used for Java, Kotlin, Android, and JVM-based applications. Compared with Maven, Gradle offers flexible build scripts, incremental builds, and improved performance for large projects.

This guide explains how to install Gradle on AlmaLinux 10 and verify that it is working correctly.

Prerequisites

Gradle requires Java to run.

Verify that Java is installed:

java -version

If Java is not installed, refer to:

* How to Install OpenJDK 21 on AlmaLinux 10 https://hightrulys.com/2026-06-24_how-to-install-openjdk-21-on-almalinux-10

Update System Packages

Update the package repository metadata:

sudo dnf update -y

Install Gradle

Install Gradle using DNF:

sudo dnf install gradle -y

The package manager will automatically install all required dependencies.

Verify the Installation

Check the installed Gradle version:

gradle --version

Example output:

------------------------------------------------------------
Gradle 8.x
------------------------------------------------------------
Build time:
Kotlin:
Groovy:
JVM:
OS:

This confirms that Gradle has been installed successfully.

Create a Test Project

Create a new project directory:

mkdir hello-gradle
cd hello-gradle

Initialize a Gradle project:

gradle init

Choose:

Application
Java
Groovy DSL

or accept the default options.

Build the Project

Compile and build the application:

gradle build

If the build succeeds, Gradle will display:

BUILD SUCCESSFUL

The generated files will be stored in:

build/

Gradle Cache Location

By default, Gradle stores downloaded dependencies and caches in:

~/.gradle

Common directories include:

~/.gradle/caches
~/.gradle/wrapper

To view the cache size:

du -sh ~/.gradle

Clean Gradle Cache

If dependencies become corrupted or disk space is limited, remove the cache:

rm -rf ~/.gradle/caches

Gradle will automatically download required files again during the next build.

Uninstall Gradle

Remove Gradle:

sudo dnf remove gradle -y

Verify removal:

gradle --version

You should receive a command not found error.

Conclusion

Installing Gradle on AlmaLinux 10 is straightforward using DNF. After installation, you can create Java projects, manage dependencies, and automate builds with a modern and flexible build system.

Related AlmaLinux 10 Tutorials

How to Install OpenJDK 21 on AlmaLinux 10

How to Install Maven on AlmaLinux 10

How to Install Git on AlmaLinux 10

Explore More

Technology Guides →

Southeast Asia Insights →