How to Install Gradle on OpenSUSE Latest
Gradle is an open-source build automation tool that is used to manage large-scale software projects for Java, C++, Python, and other programming languages. In this tutorial, you will learn how to install Gradle on OpenSUSE Latest.
Prerequisites
Before we install Gradle, we need to make sure that our system meets the following requirements:
- OpenSUSE Latest installed on your system
- Root privileges
Step 1: Update System
We need to make sure that our system is up-to-date:
sudo zypper update
Step 2: Install Java Development Kit
Gradle requires Java Development Kit (JDK) to be installed on your system. Run the following command to install JDK:
sudo zypper install java-1_8_0-openjdk-devel
Step 3: Download Gradle
Visit the Gradle website http://gradle.org/ and download the latest Gradle binary release. For this tutorial, we will be using Gradle version 7.2. You can replace the version number in the following commands with the version you downloaded:
wget https://downloads.gradle-dn.com/distributions/gradle-7.2-bin.zip -P /tmp
Step 4: Extract Gradle
Once the download is complete, extract the Gradle archive to the /opt directory:
sudo unzip -d /opt /tmp/gradle-7.2-bin.zip
Step 5: Configure Environment Variables
We need to configure the environment variables to use Gradle. Run the following commands to add Gradle's bin directory to the PATH variable:
echo "export PATH=/opt/gradle-7.2/bin:\$PATH" >> ~/.bashrc
source ~/.bashrc
Step 6: Verify Installation
We can verify the installation of Gradle by running the following command:
gradle -v
This will output the version of Gradle installed on your system.
Congratulations! You have successfully installed Gradle on your OpenSUSE Latest system.