{"id":9682,"date":"2021-07-19T22:09:23","date_gmt":"2021-07-19T19:09:23","guid":{"rendered":"https:\/\/kifarunix.com\/?p=9682"},"modified":"2024-03-18T19:36:40","modified_gmt":"2024-03-18T16:36:40","slug":"install-gradle-on-rocky-linux-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-gradle-on-rocky-linux-8\/","title":{"rendered":"Install Gradle on Rocky Linux 8"},"content":{"rendered":"\n
In this blog post, you will learn how to install Gradle on Rocky Linux 8. According to the documentation page<\/a>, “Gradle is an open-source build automation tool focused on flexibility and performance. Gradle build scripts are written using a Groovy<\/a> or Kotlin<\/a> DSL<\/em>.”<\/p>\n\n\n\n Some of the Gradle’s features include but not limited to;<\/p>\n\n\n\n Read more on features page<\/a>.<\/p>\n\n\n\n Gradle requires Java 8 or higher to run. In this demo, we will be using Java 11.<\/p>\n\n\n\n To install Java JDK 11 on Rocky Linux 8, which is available on the default Rocky Linux 8 AppStream repos, run the command below to install Java 11 on Rocky Linux 8.<\/p>\n\n\n\n There are different ways in which you can install Gradle:<\/p>\n\n\n\n To install Gradle using SDMAN! package manager, proceed as follows.<\/p>\n\n\n\n Install SDMAN! package manager on Rocky Linux 8.<\/p>\n\n\n\n To confirm that SDKMAN! package manager is installed and working fine, run the command;<\/p>\n\n\n\n Once the SDMAN! package manager is installed, then install Gradle;<\/p>\n\n\n\n First, check the current stable release version of Gradle on the releases page<\/a>. As of this writing, Gradle 7.1.1 is the current stable release.<\/p>\n\n\n\n You can also list available version using the package manager;<\/p>\n\n\n\n Hence, replace the value of the VER variable below with the specific version of Gradle you are installing and execute the installation command;<\/p>\n\n\n\n Once the installation is done, you can now start using Gradle. For example, to verify the installed version, run the command below;<\/p>\n\n\n\n Download the latest release file from Gradle release page<\/a>.<\/p>\n\n\n\n Extract the binary files;<\/p>\n\n\n\n Update the PATH environment variable to include path to Gradle binary files directory, Checking the version;<\/p>\n\n\n\n You can consult Gradle User Manual for usage information<\/a>.<\/p>\n\n\n\n\n
Installing Gradle on Rocky Linux 8<\/h2>\n\n\n\n
Install Java JDK on Rocky Linux 8<\/h3>\n\n\n\n
java -version<\/code><\/pre>\n\n\n\n
openjdk version \"11.0.11\" 2021-04-20 LTS\nOpenJDK Runtime Environment 18.9 (build 11.0.11+9-LTS)\nOpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9-LTS, mixed mode, sharing)<\/code><\/pre>\n\n\n\n
dnf install java-11-openjdk-devel<\/code><\/pre>\n\n\n\n
Install Gradle on Rocky Linux 8<\/h3>\n\n\n\n
\n
Install Gradle using SDMAN! Package Manager<\/h4>\n\n\n\n
dnf install zip<\/code><\/pre>\n\n\n\n
curl -s \"https:\/\/get.sdkman.io\" | bash<\/code><\/pre>\n\n\n\n
source \"$HOME\/.sdkman\/bin\/sdkman-init.sh\"<\/code><\/pre>\n\n\n\n
sdk help<\/code><\/pre>\n\n\n\n
\nUsage: sdk
sdk list gradle<\/code><\/pre>\n\n\n\n
VER=7.1.1<\/code><\/pre>\n\n\n\n
sdk install gradle $VER<\/code><\/pre>\n\n\n\n
gradle -v<\/code><\/pre>\n\n\n\n
\nWelcome to Gradle 7.1.1!\n\nHere are the highlights of this release:\n - Faster incremental Java compilation\n - Easier source set configuration in the Kotlin DSL\n\nFor more details see https:\/\/docs.gradle.org\/7.1.1\/release-notes.html\n\n\n------------------------------------------------------------\nGradle 7.1.1\n------------------------------------------------------------\n\nBuild time: 2021-07-02 12:16:43 UTC\nRevision: 774525a055494e0ece39f522ac7ad17498ce032c\n\nKotlin: 1.4.31\nGroovy: 3.0.7\nAnt: Apache Ant(TM) version 1.10.9 compiled on September 27 2020\nJVM: 11.0.11 (Red Hat, Inc. 11.0.11+9-LTS)\nOS: Linux 4.18.0-305.7.1.el8_4.x86_64 amd64\n\n<\/code><\/pre>\n\n\n\n
Install Gradle using Binary Files<\/h3>\n\n\n\n
VER=7.1.1<\/code><\/pre>\n\n\n\n
wget https:\/\/downloads.gradle-dn.com\/distributions\/gradle-$VER-bin.zip -P \/tmp<\/code><\/pre>\n\n\n\n
unzip -d \/opt\/ \/tmp\/gradle-7.1.1-bin.zip<\/code><\/pre>\n\n\n\n
mv \/opt\/gradle{-7.1.1,}<\/code><\/pre>\n\n\n\n
\/opt\/gradle\/bin\/<\/strong><\/code>.<\/p>\n\n\n\n
echo 'export PATH=$PATH:\/opt\/gradle\/bin' > \/etc\/profile.d\/gradle.sh<\/code><\/pre>\n\n\n\n
chmod +x \/etc\/profile.d\/gradle.sh<\/code><\/pre>\n\n\n\n
source \/etc\/profile.d\/gradle.sh<\/code><\/pre>\n\n\n\n
gradle -v<\/code><\/pre>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n