{"id":3334,"date":"2019-06-19T12:00:13","date_gmt":"2019-06-19T09:00:13","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3334"},"modified":"2024-03-11T23:07:53","modified_gmt":"2024-03-11T20:07:53","slug":"install-gradle-on-debian-10-9","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-gradle-on-debian-10-9\/","title":{"rendered":"Install Gradle on Debian 10\/9"},"content":{"rendered":"\n<p>In this guide, we are going to learn how to install Gradle on Debian 10\/9. <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.gradle.org\/current\/userguide\/what_is_gradle.html#what_is_gradle\" target=\"_blank\">Gradle<\/a> is an open-source build automation tool for building&nbsp;(but not limited) Java-based&nbsp;projects. Gradle build scripts are written using a&nbsp;<a href=\"http:\/\/groovy-lang.org\/\" target=\"_blank\" rel=\"noopener\">Groovy<\/a>&nbsp;or&nbsp;<a href=\"https:\/\/kotlinlang.org\/\" target=\"_blank\" rel=\"noopener\">Kotlin<\/a>&nbsp;domain-specific language (DSL) instead of the XML form commonly used by Apache&nbsp;Maven&nbsp;for declaring the project configuration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Gradle on Debian 10\/9<\/h2>\n\n\n\n<p>There are two ways in which Gradle can be installed; Automatically via the package manager and manually using Gradle binary. This guide discusses both ways.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"sec:prerequisites\">Prerequisites<\/h2>\n\n\n\n<p>Gradle runs on the JVM and thus as a prerequisite, you have to install OpenJDK or JRE 8 or later. Hence, update you system and install JDK.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Run system update<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update\napt upgrade<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Java on Debian 10\/9<\/h3>\n\n\n\n<p>We have covered the installation of various versions of Java in our previous guides. See the links below.<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-oracle-java-12-on-debian-10\/\" target=\"_blank\">Install Oracle Java 12 on Debian 10<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/how-to-manually-install-oracle-java-12-on-debian-9-8-ubuntu-18-04\/\" target=\"_blank\">How to Manually Install Oracle Java 12 on Debian 10\/9\/Ubuntu 18.04<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-oracle-java-12-on-ubuntu-18-04-debian-9-8\/\" target=\"_blank\">Install Oracle Java 12 on Ubuntu 18.04\/Debian 10\/9<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-java-11-on-debian-9-8-ubuntu-18-04\/\" target=\"_blank\">Install Java 11 on Debian 10\/9\/Ubuntu 18.04<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Gradle on Debian Package Manager<\/h2>\n\n\n\n<p>To install Gradle via package manager, you need to first install <a rel=\"noreferrer noopener\" aria-label=\"SDKMAN! (opens in a new tab)\" href=\"http:\/\/sdkman.io\/\" target=\"_blank\">SDKMAN!<\/a>, a tool for managing parallel versions of multiple Software Development Kits on most Unix-like systems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install SDKMAN! on Debian 10\/9<\/h3>\n\n\n\n<p>To install SDKMAN!, run the commands below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install zip curl<\/code><\/pre>\n\n\n\n<pre id=\"block-2ebdc551-f947-42b8-b126-47c3fd638284\" class=\"wp-block-preformatted\">curl -s \"https:\/\/get.sdkman.io\" | bash<\/code><\/pre>\n\n\n\n<p>SDKMAN! is installed on your home directory. Hence, once the installation is done, run the command below source the SDKMAN! init script.<\/p>\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 verify SDKMAN! installation;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sdk version<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>...\nSDKMAN 5.12.1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Gradle on Debian<\/h3>\n\n\n\n<p>You can now install Gradle using SDKMAN! by running the command;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sdk install gradle<\/code><\/pre>\n\n\n\n<p>You can also specify the version to install e.g;<\/p>\n\n\n\n<pre id=\"block-65152673-cb47-4c9f-90f8-28655bf6af65\" class=\"wp-block-preformatted\">sdk install gradle VERSION<\/code><\/pre>\n\n\n\n<p>Replace <strong>VERSION<\/strong> with the version number of Gradle to install. To list the available versions, run the command below;<\/p>\n\n\n\n<pre id=\"block-c05120d5-9ca7-4a55-8f20-dda73503108c\" class=\"wp-block-preformatted\">sdk list gradle<\/code><\/pre>\n\n\n\n<p>Once the installation of Gradle completes, the installed version is displayed. You can as well check the version as shown 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 (Debian 11.0.11+9-post-Debian-1deb10u1)\nOS:           Linux 4.19.0-17-amd64 amd64\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installing Gradle Manually via the Gradle Binary<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Download Gradle Binary<\/h4>\n\n\n\n<p>To manually install Gradle using the binary, navigate to <a rel=\"noreferrer noopener\" aria-label=\"Grade releases page (opens in a new tab)\" href=\"https:\/\/gradle.org\/releases\/\" target=\"_blank\">Grade releases page<\/a> and grab the <a rel=\"noreferrer noopener\" aria-label=\"latest release binary (opens in a new tab)\" href=\"https:\/\/gradle.org\/next-steps\/?version=7.1.1&amp;format=bin\" target=\"_blank\">latest release binary<\/a>. As of this writing, it is version 7.1.1. You can simply download the binary with <strong>wget<\/strong> command as follows.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>wget https:\/\/downloads.gradle.org\/distributions\/gradle-7.1.1-bin.zip<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Extract the Binary<\/h4>\n\n\n\n<p>Once the installation is done, extract the binary to install directory. This demo uses <strong>\/opt\/<\/strong> directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>unzip gradle-7.1.1-bin.zip -d \/opt\/<\/code><\/pre>\n\n\n\n<p>The Gradle 7.1.1 contents are extracted to <strong>\/opt\/gradle-7.1.1<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ls \/opt\/gradle-7.1.1<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>bin  init.d  lib  LICENSE  NOTICE  README<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Configure Gradle Environment Variables<\/h4>\n\n\n\n<p>Next, you need to create global Gradle home environment variable, GRADLE_HOME. You also need to add the Gradle <strong>bin<\/strong> directory to your PATH. These configs can be defined under the <strong>\/etc\/profile.d\/<\/strong> as a script.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat &gt; \/etc\/profile.d\/gradle.sh &lt;&lt; 'EOL'\nexport GRADLE_HOME=\/opt\/gradle-7.1.1\nexport PATH=${GRADLE_HOME}\/bin:${PATH}\nEOL<\/code><\/pre>\n\n\n\n<p>Next, add the execute permissions to the script.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chmod +x \/etc\/profile.d\/gradle.sh<\/code><\/pre>\n\n\n\n<p>Once that is done, source the script to load the Gradle environment variables set.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>source \/etc\/profile.d\/gradle.sh<\/code><\/pre>\n\n\n\n<p>Next, verify the version of Gradle installed.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>gradle -v<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\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 (Debian 11.0.11+9-post-Debian-1deb10u1)\nOS:           Linux 4.19.0-17-amd64 amd64\n<\/code><\/pre>\n\n\n\n<p>Well, you have successfully installed Gradle and that is all on how to install Gradle on Debian.<\/p>\n\n\n\n<p>Reference:<\/p>\n\n\n\n<p><a aria-label=\"Getting started with Gradle (opens in a new tab)\" href=\"https:\/\/docs.gradle.org\/current\/userguide\/getting_started.html\" target=\"_blank\" rel=\"noreferrer noopener\">Getting started with Gradle<\/a><\/p>\n\n\n\n<p>Other Tutorials<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-gradle-on-rocky-linux-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Gradle on Rocky Linux 8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we are going to learn how to install Gradle on Debian 10\/9. Gradle is an open-source build automation tool for building&nbsp;(but not<\/p>\n","protected":false},"author":2,"featured_media":9734,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,992,795],"tags":[997,3867,3870,3871,3869,797,3872],"class_list":["post-3334","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-automation","category-java","tag-debian-10","tag-gradle","tag-gradle-debian-10","tag-install-gradle-debian","tag-install-gradle-debian-10","tag-java","tag-sdkman","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\/3334"}],"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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=3334"}],"version-history":[{"count":5,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3334\/revisions"}],"predecessor-version":[{"id":21164,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3334\/revisions\/21164"}],"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=3334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=3334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=3334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}