Gradle is a build automation tool that integrates with multiple IDEs. Install of Gradle on Linux and Windows systems are pretty similar.
As a part of our Server Management Services, we help our Customers with Software installations regularly.
Let us today discuss steps to install and configure Gradle on Linux and Windows system.
How to install Gradle on a Linux system?
The first step in installing Gradle it to make a directory to house Gradle by running the following command:
root@ubuntu:~# mkdir /opt/gradle
The next step is to download the Gradle binary using the following curl command:
root@ubuntu:~# curl -L https://services.gradle.org/distributions/gradle-6.5-bin.zip --output gradle.zip
We will install Gradle 6.5 and check the Gradle releases page for newer versions. Next, unzip Gradle into the /opt/gradle directory:
root@ubuntu:~# unzip -d /opt/gradle/ gradle.zip
Configure Environment in Linux
To make the Gradle command accessible run the following command to add a gradle.sh file to /etc/profile.d to include Gradle in the system PATH variable:
root@ubuntu:~# echo PATH=$PATH:/opt/gradle/gradle-6.5/bin > /etc/profile.d/gradle.sh
Finally, source the newly created gradle.sh file to update the PATH environment variable:
root@ubuntu:~# source /etc/profile.d/gradle.sh
To verify the installation, run the following command:
root@ubuntu:~# gradle -v
------------------------------------------------------------
Gradle 6.5
------------------------------------------------------------
Build time: 2020-06-02 20:46:21 UTC
Revision: a27f41e4ae5e8a41ab9b19f8dd6d86d7b384dad4
Kotlin: 1.3.72
Groovy: 2.5.11
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 11.0.7 (Ubuntu 11.0.7+10-post-Ubuntu-2ubuntu218.04)
OS: Linux 4.15.0-91-generic amd64
It confirms that Gradle installation is successful.
How to install Gradle on Windows System?
The first step in this installation process is to download the Latest Gradle. Start by opening up a command prompt and creating a directory for Gradle to land:
C:\Users\Administrator>mkdir C:\Gradle
Download Gradle into the newly created Gradle directory by running the following curl command:
C:\Users\Administrator>curl -L https://services.gradle.org/distributions/gradle-6.5-bin.zip --output C:\Gradle\gradle.zip
Next, open an instance of File Explorer and navigate to the C:\Gradle directory.nNow, extract the gradle.zip file by right-clicking the file and selecting “Extract All…”.
Before hitting the Extract button, adjust the path to extract the files directly to the Gradle directory. Once it does, hit the Extract button:
Configure Environment in Windows
After the Gradle installation, it is time to set up the Environmental Variable for it. Right-click “This PC” in the File Explorer and select “Properties”.
For that, in the System menu, select Advanced system settings. Then in the System Properties dialog hit the “Environment Variables…” button.
Find “Path” under the “System variables” header and select it and hit the “Edit” button.
After that, hit the “New” button enter C:\Gradle\gradle-6.5\bin then hit the “OK” button to save the new variable.
Step #3: Verify Gradle Installation
To verify that Gradle has been installed and is available, close the current command prompt, open a new one, and run the following command:
C:\Users\Administrator>gradle -v
Welcome to Gradle 6.5!
Here are the highlights of this release:
- Experimental file-system watching
- Improved version ordering
- New samples
For more details see https://docs.gradle.org/6.5/release-notes.html
------------------------------------------------------------
Gradle 6.5
------------------------------------------------------------
Build time: 2020-06-02 20:46:21 UTC
Revision: a27f41e4ae5e8a41ab9b19f8dd6d86d7b384dad4
Kotlin: 1.3.72
Groovy: 2.5.11
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 14.0.1 (Oracle Corporation 14.0.1+7)
OS: Windows Server 2019 10.0 amd64
[Need any further assistance to install Gradle? – We’re available 24*7]
Conclusion
In short, install of Gradle on Linux and Windows can be easily performed from the installation files available on the official site. Today, we saw how our Support Engineers install and configure Gradle.
0 Comments