Gradle installation in Ubuntu 20.04


JDK Should be installed


Distrib:

http://www.gradle.org/downloads


Gradle 7.4.1 Installation

$ cd /tmp
$ wget https://services.gradle.org/distributions/gradle-7.4.1-all.zip


$ unzip gradle-7.4.1-all.zip
$ sudo mv gradle-7.4.1 /opt/
$ sudo ln -s /opt/gradle-7.4.1/ /opt/gradle


$ sudo vi /etc/profile.d/gradle-7.4.1.sh


#### GRADLE 7.4.1 ###########################

export GRADLE_HOME=/opt/gradle
export PATH=${GRADLE_HOME}/bin:$PATH

#### GRADLE 7.4.1 ###########################


$ sudo chmod 755 /etc/profile.d/gradle-7.4.1.sh
$ source /etc/profile.d/gradle-7.4.1.sh


$ gradle --version


Gradle 6.7.1 Installation


$ cd /tmp
$ wget https://services.gradle.org/distributions/gradle-6.7.1-all.zip


$ unzip gradle-6.7.1-all.zip
$ sudo mv gradle-6.7.1 /opt/
$ sudo ln -s /opt/gradle-6.7.1/ /opt/gradle


$ sudo vi /etc/profile.d/gradle-6.7.1.sh


#### GRADLE 6.7.1 ###########################

export GRADLE_HOME=/opt/gradle
export PATH=${GRADLE_HOME}/bin:$PATH

#### GRADLE 6.7.1 ###########################


$ sudo chmod 755 /etc/profile.d/gradle-6.7.1.sh
$ source /etc/profile.d/gradle-6.7.1.sh


Let try to check result:


$ gradle --version


Gradle compatibility with JDK

https://docs.gradle.org/current/userguide/compatibility.html