Today we are going to learn that how we can Install Gradle on CentOS 8. Gradle is free & Open Source tool that is widely used for the Java projects. The programming language used by the Gradle is Groovy that is dynamic and well defined OOP (Object oriented programming) language. It is also used for the development of scripts for Java language. You can also see the variety of Gradle projects in Android alos. So, without wasting time let’s move towards the insallation of Gradle on CentOS 8. Just follow the below steps for easy installation.
Here’s the list of requirements you need to install Gradle on CentOS 8.
- Gradle Package
- Environment Variables
Make sure you’ve sudo privileges.
Step 1: Install OpenJDK
First of all install the Java on your CentOS system. Fire the below command to install OpenJDK 8 on CentOS 8.
sudo yum install java-1.8.0-openjdk-devel
Verify the installation of Java by running the below command.
Step 2: Downloading Gradle
To download Gradle, go to their official release page. The latest available version at the time of this writing is 6.2.2 released on March 04, 2020. You can visit the official site if there’s new version available.
So, download it from the website or run the following command in your terminal
wget https://services.gradle.org/distributions/gradle-6.2.2-bin.zip -P /tmp
Then unzip the package downloaded by
sudo unzip -d /opt/gradle /tmp/gradle-6.2.2-bin.zip
Step 3: Setting Up Environment Variables
PATH Environment variable must include the Gradle directory. So, make a new file with the name gradle.sh under the /etc/profile.d/ directory.
sudo nano /etc/profile.d/gradle.sh
After it paste the below data into the file.
Then Save and close the file.
Run the given command to make your script executable
sudo chmod +x /etc/profile.d/gradle.sh
After it load the Environment variables by typing
As we’ve all done, so check the version of Installed Gradle to verify our Installation.
So, this is how you can Install Gradle on your CentOS 8.