Linux

How to install Gradle on Ubuntu

GRADLE-FEATURE

Gradle is a build tool that is well-known for its versatility in software development, especially with regard to automation. The process of making applications is automated using a build automation tool. Compiling, linking, and packaging the code are all part of the application production process. With the help of build automation technologies, the process becomes more uniform. Gradle is well-known for its ability to create automation in Java, Scala, Android, C/C++, and Groovy. Over XML, the program offers groovy-based Domain Specific Language. Gradle allows you to build, test, and distribute applications across several platforms. Gradle builds can be used to specify a project’s tasks and dependencies. The project’s root folder contains at least one Gradle build file. A task represents the work that a Gradle build must complete, such as assembling the program’s source code. Multiple tasks can be run at the same time in a single build file. At runtime, these tasks can be dynamically created and extended.

This article will show you what Gradle is all about and how to get started having it installed on Ubuntu /Debian-based machines. Other related articles can be found here How to Install & Configure Microsoft Teams on Ubuntu/, How to Install Apache OpenOffice on Ubuntu /, How to install PostgreSQL on Ubuntu/, How to install and configure Tripwire on Ubuntu/, How to install Node.js on Ubuntu

What Gradle can do for you

  • Gradle eliminates all of the problems that other build tools, such as Maven and ANT, have.
  • Maintainability, usability, extendibility, performance, and flexibility are all priorities for the tool.
  • When it comes to different projects involving multiple technologies, it is well-known for being very customizable. Gradle can be used in a variety of ways, including Java, Android, and Groovy projects.
  • Gradle is well-known for its high-speed performance, which is double that of Maven.
  • The tools cover a wide variety of IDEs, which improves the user experience because different people prefer different IDEs to work with. It gives a command-line interface to users that prefer to work on the terminal, with capabilities such as Gradle tasks, command-line completion, and so on.

Requirements

A computer with sudo privileges

Step1: Update your system

apt update 

Step2: Installing OpenJDK

Java SE 8 or later must be installed on the computer for Gradle to work.

sudo apt install openjdk-11-jdk

verify the installation with the command

java --version

Output is shown below:

openjdk 11.0.14 2022-01-18
OpenJDK Runtime Environment (build 11.0.14+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.14+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

Step3:  Download Gradle distribution

Please download the latest Gradle distribution using the wget command, download the Gradle binary-only zip file to the /tmp directory:

wget https://downloads.gradle-dn.com/distributions/gradle-7.0.2-bin.zip

Output

gradle-7.0.2-bin.zi  54%[=========>         ]  57.73M   706KB/s    in 5m 28s  

2022-03-28 15:00:52 (180 KB/s) - Connection closed at byte 60537067. Retrying.

--2022-03-28 15:00:53--  (try: 2)  https://downloads.gradle-dn.com/distributions/gradle-7.0.2-bin.zip
Connecting to downloads.gradle-dn.com (downloads.gradle-dn.com)|104.18.164.99|:443... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 112062163 (107M), 51525096 (49M) remaining [application/zip]
Saving to: ‘gradle-7.0.2-bin.zip’

gradle-7.0.2-bin.zi 100%[++++++++++========>] 106.87M  1.33MB/s    in 48s     

2022-03-28 15:01:41 (1.03 MB/s) - ‘gradle-7.0.2-bin.zip’ saved [112062163/112062163]

Then, after downloading the archive, extract it and save it to the appropriate area. Under general, I kept my applications in the /usr/local directory. You can use a different directory, such as /opt.

unzip gradle-7.0.2-bin.zip
mv gradle-7.0.2 /usr/local/gradle

Output

rdgmh@ubuntu:~$ unzip gradle-7.0.2-bin.zip
Archive:  gradle-7.0.2-bin.zip
   creating: gradle-7.0.2/
  inflating: gradle-7.0.2/LICENSE    
  inflating: gradle-7.0.2/NOTICE     
  inflating: gradle-7.0.2/README     
   creating: gradle-7.0.2/init.d/
  inflating: gradle-7.0.2/init.d/readme.txt  
   creating: gradle-7.0.2/bin/
  inflating: gradle-7.0.2/bin/gradle  
  inflating: gradle-7.0.2/bin/gradle.bat  
   creating: gradle-7.0.2/lib/
  inflating: gradle-7.0.2/lib/gradle-runtime-api-info-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-installation-beacon-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-api-metadata-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-launcher-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-kotlin-dsl-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-bootstrap-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-build-events-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-tooling-api-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-core-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-file-collections-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-jvm-services-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-execution-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-model-groovy-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-model-core-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-build-cache-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-core-api-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-persistent-cache-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-worker-processes-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-logging-7.0.2.jar  
  inflating: gradle-7.0.2/lib/groovy-ant-3.0.7.jar  
  inflating: gradle-7.0.2/lib/ant-junit-1.10.9.jar  
  inflating: gradle-7.0.2/lib/ant-1.10.9.jar  
  inflating: gradle-7.0.2/lib/ant-launcher-1.10.9.jar  
  inflating: gradle-7.0.2/lib/gradle-process-services-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-resources-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-messaging-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-native-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-base-services-groovy-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-file-temp-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-base-services-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-normalization-java-7.0.2.jar  
  inflating: gradle-7.0.2/lib/asm-commons-9.1.jar  
  inflating: gradle-7.0.2/lib/asm-analysis-9.1.jar  
  inflating: gradle-7.0.2/lib/asm-tree-9.1.jar  
  inflating: gradle-7.0.2/lib/asm-9.1.jar  
  inflating: gradle-7.0.2/lib/gradle-build-cache-packaging-7.0.2.jar  
  inflating: gradle-7.0.2/lib/commons-compress-1.20.jar  
  inflating: gradle-7.0.2/lib/commons-io-2.6.jar  
  inflating: gradle-7.0.2/lib/gradle-build-option-7.0.2.jar  
  inflating: gradle-7.0.2/lib/commons-lang-2.6.jar  
  inflating: gradle-7.0.2/lib/fastutil-8.5.2-min.jar  
  inflating: gradle-7.0.2/lib/groovy-json-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-astbuilder-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-console-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-dateutil-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-datetime-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-groovydoc-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-nio-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-sql-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-docgenerator-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-templates-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-test-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-xml-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-swing-3.0.7.jar  
  inflating: gradle-7.0.2/lib/groovy-3.0.7.jar  
  inflating: gradle-7.0.2/lib/gradle-file-watching-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-snapshots-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-build-cache-base-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-files-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-hashing-7.0.2.jar  
  inflating: gradle-7.0.2/lib/guava-27.1-android.jar  
  inflating: gradle-7.0.2/lib/junit-4.13.2.jar  
  inflating: gradle-7.0.2/lib/hamcrest-core-1.3.jar  
  inflating: gradle-7.0.2/lib/javax.inject-1.jar  
  inflating: gradle-7.0.2/lib/jansi-1.18.jar  
  inflating: gradle-7.0.2/lib/jcl-over-slf4j-1.7.30.jar  
  inflating: gradle-7.0.2/lib/kotlin-stdlib-jdk8-1.4.31.jar  
  inflating: gradle-7.0.2/lib/kotlin-compiler-embeddable-1.4.31-patched-for-gradle-7.0.2.jar  
  inflating: gradle-7.0.2/lib/kotlin-stdlib-jdk7-1.4.31.jar  
  inflating: gradle-7.0.2/lib/kotlin-reflect-1.4.31.jar  
  inflating: gradle-7.0.2/lib/kotlin-stdlib-1.4.31.jar  
  inflating: gradle-7.0.2/lib/annotations-20.1.0.jar  
  inflating: gradle-7.0.2/lib/gradle-kotlin-dsl-tooling-models-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-build-operations-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-base-annotations-7.0.2.jar  
  inflating: gradle-7.0.2/lib/tomlj-1.0.0.jar  
  inflating: gradle-7.0.2/lib/jsr305-3.0.2.jar  
  inflating: gradle-7.0.2/lib/jul-to-slf4j-1.7.30.jar  
  inflating: gradle-7.0.2/lib/kryo-2.24.0.jar  
  inflating: gradle-7.0.2/lib/log4j-over-slf4j-1.7.30.jar  
  inflating: gradle-7.0.2/lib/minlog-1.2.jar  
  inflating: gradle-7.0.2/lib/native-platform-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/file-events-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/objenesis-2.6.jar  
  inflating: gradle-7.0.2/lib/slf4j-api-1.7.30.jar  
  inflating: gradle-7.0.2/lib/trove4j-1.0.20181211.jar  
  inflating: gradle-7.0.2/lib/xml-apis-1.4.01.jar  
  inflating: gradle-7.0.2/lib/javaparser-core-3.17.0.jar  
  inflating: gradle-7.0.2/lib/gradle-wrapper-7.0.2.jar  
  inflating: gradle-7.0.2/lib/gradle-cli-7.0.2.jar  
  inflating: gradle-7.0.2/lib/kotlin-script-runtime-1.4.31.jar  
  inflating: gradle-7.0.2/lib/kotlin-daemon-embeddable-1.4.31.jar  
  inflating: gradle-7.0.2/lib/kotlin-scripting-common-1.4.31.jar  
  inflating: gradle-7.0.2/lib/kotlin-scripting-jvm-1.4.31.jar  
  inflating: gradle-7.0.2/lib/kotlin-scripting-jvm-host-1.4.31.jar  
  inflating: gradle-7.0.2/lib/kotlin-scripting-compiler-embeddable-1.4.31.jar  
  inflating: gradle-7.0.2/lib/kotlin-scripting-compiler-impl-embeddable-1.4.31.jar  
  inflating: gradle-7.0.2/lib/kotlin-sam-with-receiver-compiler-plugin-1.4.31.jar  
  inflating: gradle-7.0.2/lib/kotlinx-metadata-jvm-0.2.0.jar  
  inflating: gradle-7.0.2/lib/failureaccess-1.0.1.jar  
  inflating: gradle-7.0.2/lib/gradle-problems-7.0.2.jar  
  inflating: gradle-7.0.2/lib/native-platform-freebsd-amd64-libcpp-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-linux-aarch64-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-linux-amd64-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-osx-aarch64-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-osx-amd64-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-windows-amd64-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-windows-amd64-min-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-windows-i386-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-windows-i386-min-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-linux-aarch64-ncurses5-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-linux-aarch64-ncurses6-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-linux-amd64-ncurses5-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/native-platform-linux-amd64-ncurses6-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/file-events-linux-aarch64-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/file-events-linux-amd64-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/file-events-osx-aarch64-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/file-events-osx-amd64-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/file-events-windows-amd64-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/file-events-windows-amd64-min-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/file-events-windows-i386-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/file-events-windows-i386-min-0.22-milestone-16.jar  
  inflating: gradle-7.0.2/lib/ant-antlr-1.10.9.jar  
  inflating: gradle-7.0.2/lib/antlr4-runtime-4.7.2.jar  
  inflating: gradle-7.0.2/lib/kotlin-stdlib-common-1.4.31.jar  
  inflating: gradle-7.0.2/lib/qdox-1.12.1.jar  
   creating: gradle-7.0.2/lib/plugins/
  inflating: gradle-7.0.2/lib/plugins/gradle-kotlin-dsl-provider-plugins-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-plugin-development-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-build-init-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-build-profile-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-antlr-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-enterprise-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-tooling-api-builders-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-configuration-cache-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-kotlin-dsl-tooling-builders-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-code-quality-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-signing-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-tooling-native-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-ide-native-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-ide-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-scala-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-ear-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-jacoco-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-testing-native-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-language-native-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-maven-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-ivy-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-plugins-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-testing-junit-platform-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-testing-jvm-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-language-groovy-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-language-java-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-language-jvm-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-platform-jvm-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-composite-builds-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-plugin-use-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-publish-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-testing-base-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-platform-native-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-diagnostics-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-platform-base-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-version-control-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-dependency-management-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-reporting-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-workers-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-test-kit-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-resources-s3-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-resources-gcs-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-build-cache-http-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-security-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-resources-http-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-resources-sftp-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/aws-java-sdk-s3-1.11.948.jar  
  inflating: gradle-7.0.2/lib/plugins/aws-java-sdk-kms-1.11.948.jar  
  inflating: gradle-7.0.2/lib/plugins/aws-java-sdk-sts-1.11.948.jar  
  inflating: gradle-7.0.2/lib/plugins/aws-java-sdk-core-1.11.948.jar  
  inflating: gradle-7.0.2/lib/plugins/org.eclipse.jgit-5.7.0.202003110725-r.jar  
  inflating: gradle-7.0.2/lib/plugins/bcpg-jdk15on-1.68.jar  
  inflating: gradle-7.0.2/lib/plugins/bcpkix-jdk15on-1.68.jar  
  inflating: gradle-7.0.2/lib/plugins/bcprov-jdk15on-1.68.jar  
  inflating: gradle-7.0.2/lib/plugins/testng-6.3.1.jar  
  inflating: gradle-7.0.2/lib/plugins/bsh-2.0b6.jar  
  inflating: gradle-7.0.2/lib/plugins/google-api-services-storage-v1-rev171-1.25.0.jar  
  inflating: gradle-7.0.2/lib/plugins/google-api-client-1.25.0.jar  
  inflating: gradle-7.0.2/lib/plugins/google-oauth-client-1.25.0.jar  
  inflating: gradle-7.0.2/lib/plugins/google-http-client-jackson2-1.25.0.jar  
  inflating: gradle-7.0.2/lib/plugins/google-http-client-1.25.0.jar  
  inflating: gradle-7.0.2/lib/plugins/httpclient-4.5.13.jar  
  inflating: gradle-7.0.2/lib/plugins/commons-codec-1.15.jar  
  inflating: gradle-7.0.2/lib/plugins/gson-2.8.6.jar  
  inflating: gradle-7.0.2/lib/plugins/jmespath-java-1.11.948.jar  
  inflating: gradle-7.0.2/lib/plugins/jackson-databind-2.12.1.jar  
  inflating: gradle-7.0.2/lib/plugins/jackson-core-2.12.1.jar  
  inflating: gradle-7.0.2/lib/plugins/jackson-annotations-2.12.1.jar  
  inflating: gradle-7.0.2/lib/plugins/httpcore-4.4.14.jar  
  inflating: gradle-7.0.2/lib/plugins/maven-settings-builder-3.6.3.jar  
  inflating: gradle-7.0.2/lib/plugins/ivy-2.3.0.jar  
  inflating: gradle-7.0.2/lib/plugins/jaxb-impl-3.0.0.jar  
  inflating: gradle-7.0.2/lib/plugins/jaxb-core-3.0.0.jar  
  inflating: gradle-7.0.2/lib/plugins/jakarta.xml.bind-api-3.0.0.jar  
  inflating: gradle-7.0.2/lib/plugins/jakarta.activation-2.0.0.jar  
  inflating: gradle-7.0.2/lib/plugins/jatl-0.2.3.jar  
  inflating: gradle-7.0.2/lib/plugins/jcifs-1.3.17.jar  
  inflating: gradle-7.0.2/lib/plugins/jcommander-1.78.jar  
  inflating: gradle-7.0.2/lib/plugins/joda-time-2.10.4.jar  
  inflating: gradle-7.0.2/lib/plugins/jsch-0.1.55.jar  
  inflating: gradle-7.0.2/lib/plugins/junit-platform-engine-1.7.1.jar  
  inflating: gradle-7.0.2/lib/plugins/junit-platform-commons-1.7.1.jar  
  inflating: gradle-7.0.2/lib/plugins/junit-platform-launcher-1.7.1.jar  
  inflating: gradle-7.0.2/lib/plugins/jzlib-1.1.3.jar  
  inflating: gradle-7.0.2/lib/plugins/maven-builder-support-3.6.3.jar  
  inflating: gradle-7.0.2/lib/plugins/maven-model-3.6.3.jar  
  inflating: gradle-7.0.2/lib/plugins/maven-repository-metadata-3.6.3.jar  
  inflating: gradle-7.0.2/lib/plugins/maven-settings-3.6.3.jar  
  inflating: gradle-7.0.2/lib/plugins/nekohtml-1.9.22.jar  
  inflating: gradle-7.0.2/lib/plugins/plexus-sec-dispatcher-1.4.jar  
  inflating: gradle-7.0.2/lib/plugins/plexus-cipher-1.7.jar  
  inflating: gradle-7.0.2/lib/plugins/plexus-interpolation-1.26.jar  
  inflating: gradle-7.0.2/lib/plugins/plexus-utils-3.3.0.jar  
  inflating: gradle-7.0.2/lib/plugins/dd-plist-1.21.jar  
  inflating: gradle-7.0.2/lib/plugins/snakeyaml-1.28.jar  
  inflating: gradle-7.0.2/lib/plugins/xercesImpl-2.12.0.jar  
  inflating: gradle-7.0.2/lib/plugins/gradle-java-compiler-plugin-7.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/ion-java-1.0.2.jar  
  inflating: gradle-7.0.2/lib/plugins/apiguardian-api-1.1.0.jar  
  inflating: gradle-7.0.2/lib/plugins/opentest4j-1.2.0.jar 
mv gradle-7.0.2 /usr/local/gradle

Your system has been set up with Gradle.

Step4: Setup Environment Variable

The next step is to configure Gradle with the PATH environment variable. Make sure the variable is set after the machine is rebooted.

To set the PATH variable on reboot, place a shell script in the profile.d directory. Make a file that looks like this:

vim /etc/profile.d/gradle.sh

save the file with the following line added to it

export PATH=/usr/local/gradle/bin:$PATH

Save and close the file. Now you may use the script to apply the current shell’s environment.

source /etc/profile.d/gradle.sh

And you’ve successfully installed Grandle on your Ubuntu machine.

Step5: Test Gradle Setup

Your system’s Gradle has been successfully configured. To create your apps, you can utilize the Gradle tool. Let’s have a look at your system’s installed version.

Output

Gradleonubuntu

Step6: Uninstall Gradle (If need be)

Gradle was installed through binary package, therefore all we have to do now is delete the packages using the rm -rf /usr/local/gradle/gradle-7.0.2/ command, that is in the code block below:

 rm -rf /usr/local/gradle/gradle-7.0.2/

Then, as shown below, remove the gradle.sh script with the rm -rf /etc/profile.d/gradle.sh command. This will delete the Gradle package from computer completely.

rm -rf /etc/profile.d/gradle.sh

Summary

We have successfully set up Gradle in Ubuntu 20.04 and these steps can work for any other version of Ubuntu as well. We have also shown you how to remove Gradle from your computer.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x