How to Install Gradle on Fedora CoreOS Latest
Gradle is an open-source build automation tool that is used to automate building, testing, and deploying software packages or projects. In this tutorial, we will show you how to install Gradle on Fedora CoreOS latest.
Prerequisites
Before you begin to install Gradle, make sure you have the following:
- A Fedora CoreOS latest instance.
- Access to the root or sudo user account.
Installing Gradle
Follow the steps below to install Gradle on Fedora CoreOS latest instance:
Step 1: Update the System
Before you start with the installation, update the system to the latest version by running the following command:
sudo dnf update -y
Step 2: Install Java
Gradle requires a Java Development Kit (JDK) installed on your system. You can install OpenJDK by running the following command:
sudo dnf install java-11-openjdk-devel -y
Step 3: Download Gradle
Go to the Gradle download page and download the latest version of Gradle:
wget https://services.gradle.org/distributions/gradle-7.3-bin.zip -P /tmp
Step 4: Extract the Downloaded File
Once the download is complete, extract the downloaded file to the /opt/gradle directory by running the following command:
sudo unzip -d /opt/gradle /tmp/gradle-*.zip
Step 5: Set the Environment Variables
Next, set the environment variables for Gradle. Create a new file /etc/profile.d/gradle.sh and add the following lines to it:
export GRADLE_HOME=/opt/gradle/gradle-7.3
export PATH=${GRADLE_HOME}/bin:${PATH}
Save the file and execute it using the following command to apply the changes:
source /etc/profile.d/gradle.sh
Step 6: Verify the Installation
You can verify the installation by running the following command:
gradle -v
You should see the output like the following:
------------------------------------------------------------
Gradle 7.3
------------------------------------------------------------
Build time: 2021-10-15 02:32:15 UTC
Revision: 620bab32a2ee3600598267d245e262ae41387248
Kotlin: 1.5.31
Groovy: 3.0.9
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2021
JVM: 11.0.13 (Oracle Corporation 11.0.13+8-LTS-162)
OS: Linux 5.14.15-200.fc34.x86_64 amd64
Congratulations! You have successfully installed Gradle on your Fedora CoreOS latest instance.
Conclusion
In this tutorial, you have learned how to install Gradle on Fedora CoreOS latest. Now, you can start using Gradle to automate your build process.