Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Build Tool»How to Install Gradle on Ubuntu 20.04

    How to Install Gradle on Ubuntu 20.04

    RahulBy RahulMay 19, 20203 Mins ReadUpdated:July 12, 2020

    Gradle is an open-source build tool for the automation of applications. The Gradle helps developers team to build, automate and deliver software easier and faster, which increased their productivity. It can build applications written in Java, C++, Python or your language of choice.

    This tutorial will help you to install Gradle on Ubuntu 20.04 LTS system.

    You may like:

    • How to Install Apache Maven on Ubuntu 20.04 LTS

    Prerequisites

    You must have root or sudo privilege account access on Ubuntu 20.04 system.

    Gradle required Java language for running on any operating system. So first of all, Make sure you have Java installed on your system. also make sure you have installed JDK and JRE both.

    java -version 
    
    openjdk 11.0.7 2020-04-14
    OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1)
    OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)
    

    If you don’t have Java Development Kit installed on your system. Use below command to install it.

    sudo apt install default-jdk
    

    Step 1 – Install Gradle on Ubuntu 20.04

    After installation of Java, download the latest Gradle distribution release binary file from its official download page.

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

    Then extract the downloaded archive and place it to the proper location. Generally, I used /usr/local directory for storing applications. You can use alternative directory like /opt.

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

    Gradle has been configured on your system.

    Step 2 – Setup Environment Variable

    Next, you need to setup Gradle with PATH environment variable, Also make sure the variable is set after system reboot.

    Place a shell script under profile.d directory to set PATH variable on reboot. Create a file like below:

    vim /etc/profile.d/gradle.sh
    

    and add the below line to file

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

    Save file and close it. Now source the script to apply environment for current shell.

    source /etc/profile.d/gradle.sh
    

    And you have done the Grandle installation on Ubuntu system.

    Step 3 – Test Gradle Setup

    The Gradle has been configured successfully on your system. You can use use Gradle tool to build your applications. Let’s check the installed version on your system.

    gradle -v
    

    Output

    Welcome to Gradle 6.5.1!
    
    Here are the highlights of this release:
     - Support for building, testing and running Java Modules
     - Precompiled script plugins for Groovy DSL
     - Single dependency lock file per project
    
    For more details see https://docs.gradle.org/6.5.1/release-notes.html
    
    
    ------------------------------------------------------------
    Gradle 6.5.1
    ------------------------------------------------------------
    
    Build time:   2020-05-15 19:43:40 UTC
    Revision:     1a04183c502614b5c80e33d603074e0b4a2777c5
    
    Kotlin:       1.3.71
    Groovy:       2.5.10
    Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
    JVM:          11.0.7 (Ubuntu 11.0.7+10-post-Ubuntu-3ubuntu1)
    OS:           Linux 5.4.0-26-generic amd64
    

    Conclusion

    In this tutorial, you have learned to install Gradle on Ubuntu 20.04 LTS system.

    Build Tool Gradle opensource
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Notepad++ on Ubuntu 20.04
    Next Article How to Install Apache Maven on Ubuntu 20.04

    Related Posts

    How to Install Gradle on CentOS 8

    Updated:April 19, 20202 Mins Read

    How To Install Gradle on Fedora 35/34

    Updated:February 15, 20223 Mins Read

    How to Install Gradle on Debian 10

    Updated:April 12, 20202 Mins Read

    How to Install Gradle on CentOS 7

    Updated:April 19, 20202 Mins Read

    How To Install MySQL on CentOS/RHEL 7/6 & Fedora 32/31

    Updated:November 6, 20204 Mins Read

    1 Comment

    1. eka on December 16, 2020 3:59 pm

      Thank you for this great guide.
      Finally gradle installed on my new KDE Neon system.

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    • (Resolved) Please install all available updates for your release before upgrading
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.