{"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<p>In this blog post, you will learn how to install Gradle on Rocky Linux 8. According to the <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/userguide.html\" target=\"_blank\" rel=\"noreferrer noopener\">documentation page<\/a>, &#8220;<em>Gradle is an open-source build automation tool focused on flexibility and performance. Gradle build scripts are written using a&nbsp;<a href=\"https:\/\/groovy-lang.org\/\" target=\"_blank\" rel=\"noopener\">Groovy<\/a>&nbsp;or&nbsp;<a href=\"https:\/\/kotlinlang.org\/\" target=\"_blank\" rel=\"noopener\">Kotlin<\/a>&nbsp;DSL<\/em>.&#8221;<\/p>\n\n\n\n<p>Some of the Gradle&#8217;s features include but not limited to;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em><strong>Highly customizable<\/strong>&nbsp;\u2014 Gradle is modeled in a way that is customizable and extensible in the most fundamental ways.<\/em><\/li>\n\n\n\n<li><em><strong>Fast<\/strong>&nbsp;\u2014 Gradle completes tasks quickly by reusing outputs from previous executions, processing only inputs that changed, and executing tasks in parallel.<\/em><\/li>\n\n\n\n<li><em><strong>Powerful<\/strong>&nbsp;\u2014 Gradle is the official build tool for Android, and comes with support for many popular languages and technologies.<\/em><\/li>\n<\/ul>\n\n\n\n<p>Read more on <a href=\"https:\/\/gradle.org\/features\/\" target=\"_blank\" rel=\"noreferrer noopener\">features page<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Gradle on Rocky Linux 8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Install Java JDK on Rocky Linux 8<\/h3>\n\n\n\n<p>Gradle requires Java 8 or higher to run. In this demo, we will be using Java 11.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>java -version<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>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<p>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<pre class=\"wp-block-preformatted\"><code>dnf install java-11-openjdk-devel<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Gradle on Rocky Linux 8<\/h3>\n\n\n\n<p>There are different ways in which you can install Gradle:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"#install-gradle-with-sdman!\">Using SDMAN! package manager<\/a><\/li>\n\n\n\n<li><a href=\"#Install-gradle-using-binary-files\">Using Binary File<\/a><\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-gradle-with-sdman!\">Install Gradle using SDMAN! Package Manager<\/h4>\n\n\n\n<p>To install Gradle using SDMAN! package manager, proceed as follows.<\/p>\n\n\n\n<p>Install SDMAN! package manager on Rocky Linux 8.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install zip<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -s \"https:\/\/get.sdkman.io\" | bash<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>source \"$HOME\/.sdkman\/bin\/sdkman-init.sh\"<\/code><\/pre>\n\n\n\n<p>To confirm that SDKMAN! package manager is installed and working fine, run the command;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sdk help<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nUsage: sdk <command> [candidate] [version]\n       sdk offline <enable|disable>\n\n   commands:\n       install   or i    <candidate> [version] [local-path]\n       uninstall or rm   <candidate> <version>\n       list      or ls   [candidate]\n       use       or u    <candidate> <version>\n       config\n       default   or d    <candidate> [version]\n       home      or h    <candidate> <version>\n       env       or e    [init|install|clear]\n       current   or c    [candidate]\n       upgrade   or ug   [candidate]\n       version   or v\n       broadcast or b\n       help\n       offline           [enable|disable]\n       selfupdate        [force]\n       update\n       flush             [archives|tmp|broadcast|version]\n\n   candidate  :  the SDK to install: groovy, scala, grails, gradle, kotlin, etc.\n                 use list command for comprehensive list of candidates\n                 eg: $ sdk list\n   version    :  where optional, defaults to latest stable if not provided\n                 eg: $ sdk install groovy\n   local-path :  optional path to an existing local installation\n                 eg: $ sdk install groovy 2.4.13-local \/opt\/groovy-2.4.13\n<\/code><\/pre>\n\n\n\n<p>Once the SDMAN! package manager is installed, then install Gradle;<\/p>\n\n\n\n<p>First, check the current stable release version of Gradle on the <a href=\"https:\/\/gradle.org\/releases\/\" target=\"_blank\" rel=\"noreferrer noopener\">releases page<\/a>. As of this writing, Gradle 7.1.1 is the current stable release.<\/p>\n\n\n\n<p>You can also list available version using the package manager;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sdk list gradle<\/code><\/pre>\n\n\n\n<p>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<pre class=\"wp-block-preformatted\"><code>VER=7.1.1<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sdk install gradle $VER<\/code><\/pre>\n\n\n\n<p>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<pre class=\"wp-block-preformatted\"><code>gradle -v<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\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<h3 class=\"wp-block-heading\" id=\"Install-gradle-using-binary-files\">Install Gradle using Binary Files<\/h3>\n\n\n\n<p>Download the latest release file from <a href=\"https:\/\/gradle.org\/releases\/\" target=\"_blank\" rel=\"noreferrer noopener\">Gradle release page<\/a>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>VER=7.1.1<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/downloads.gradle-dn.com\/distributions\/gradle-$VER-bin.zip -P \/tmp<\/code><\/pre>\n\n\n\n<p>Extract the binary files;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>unzip -d \/opt\/ \/tmp\/gradle-7.1.1-bin.zip<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mv \/opt\/gradle{-7.1.1,}<\/code><\/pre>\n\n\n\n<p>Update the PATH environment variable to include path to Gradle binary files directory, <code><strong>\/opt\/gradle\/bin\/<\/strong><\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>echo 'export PATH=$PATH:\/opt\/gradle\/bin' &gt; \/etc\/profile.d\/gradle.sh<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chmod +x \/etc\/profile.d\/gradle.sh<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>source \/etc\/profile.d\/gradle.sh<\/code><\/pre>\n\n\n\n<p>Checking the version;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>gradle -v<\/code><\/pre>\n\n\n\n<p>You can consult <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/userguide.html\" target=\"_blank\" rel=\"noreferrer noopener\">Gradle User Manual for usage information<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Other Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-gradle-on-debian-10-9\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Gradle on Debian 10\/9<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-yarn-on-debian-10\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install Yarn on Debian 10 Buster<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog post, you will learn how to install Gradle on Rocky Linux 8. According to the documentation page, &#8220;Gradle is an open-source build<\/p>\n","protected":false},"author":1,"featured_media":9734,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,795],"tags":[3867,3866,3864,3868,797,3865],"class_list":["post-9682","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-java","tag-gradle","tag-install-gradle","tag-install-gradle-rocky-linux-8","tag-install-java-rocky-linux-8","tag-java","tag-rocky-linux-8-gradle","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9682"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=9682"}],"version-history":[{"count":3,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9682\/revisions"}],"predecessor-version":[{"id":21726,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/9682\/revisions\/21726"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/9734"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=9682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=9682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=9682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}