🎓 Top 15 Udemy Courses (80-90% Discount): My Udemy Courses - Ramesh Fadatare — All my Udemy courses are real-time and project oriented courses.
▶️ Subscribe to My YouTube Channel (178K+ subscribers): Java Guides on YouTube
▶️ For AI, ChatGPT, Web, Tech, and Generative AI, subscribe to another channel: Ramesh Fadatare on YouTube
Step 1: Install Java Development Kit (JDK)
Gradle requires a Java Development Kit (JDK) to run. Make sure you have JDK installed on your system. If not, install it using the following commands:
For Debian-based distributions (Ubuntu, etc.)
sudo apt update
sudo apt install openjdk-11-jdk
For Red Hat-based distributions (Fedora, CentOS, etc.)
sudo dnf install java-11-openjdk-devel
Step 2: Download the Gradle Binary
- Visit the official Gradle releases page and copy the download link for the latest binary release.
- Download the Gradle binary using
wgetorcurl. ReplaceGRADLE_VERSIONwith the actual version number you want to install (e.g., 7.4.2).
wget https://services.gradle.org/distributions/gradle-GRADLE_VERSION-bin.zip
Step 3: Extract the Gradle Binary
- Create a directory for Gradle.
sudo mkdir /opt/gradle
- Extract the downloaded ZIP file to the
/opt/gradledirectory.
sudo unzip -d /opt/gradle gradle-GRADLE_VERSION-bin.zip
- Create a symbolic link to the extracted directory for easier access.
sudo ln -s /opt/gradle/gradle-GRADLE_VERSION /opt/gradle/latest
Step 4: Set Up Environment Variables
- Open your shell profile file in a text editor. This might be
.bashrc,.zshrc, or another file, depending on your shell. For example, if you use Bash:
nano ~/.bashrc
- Add the following lines to set the
GRADLE_HOMEenvironment variable and update thePATH:
export GRADLE_HOME=/opt/gradle/latest
export PATH=$PATH:$GRADLE_HOME/bin
- Save the file and exit the text editor.
- Reload the shell configuration by running:
source ~/.bashrc
Step 5: Verify the Installation
- Check the Gradle version to verify that it has been installed correctly:
gradle -v
- You should see an output that displays the Gradle version and other related information, indicating that Gradle is successfully installed. The output should look something like this:
------------------------------------------------------------
Gradle 7.x.x
------------------------------------------------------------
Build time: yyyy-MM-dd HH:mm:ss UTC
Revision: xxxxxxxxxxxxxxxxxxxxxx
Kotlin: 1.x.x
Groovy: 3.x.x
Ant: Apache Ant(x.x.x)
JVM: x.x.x (Oracle Corporation x.x.x)
OS: Linux x.x.x-xx-generic amd64
Conclusion
You have now successfully installed Gradle on your Linux system. With Gradle installed, you can start building and managing your projects more efficiently. For more information on using Gradle, check out the official Gradle documentation.
If you encounter any issues or have any questions, feel free to ask in the comments below. Happy building!
My Top and Bestseller Udemy Courses. The sale is going on with a 70 - 80% discount. The discount coupon has been added to each course below:
Build REST APIs with Spring Boot 4, Spring Security 7, and JWT
[NEW] Learn Apache Maven with IntelliJ IDEA and Java 25
ChatGPT + Generative AI + Prompt Engineering for Beginners
Spring 7 and Spring Boot 4 for Beginners (Includes 8 Projects)
Available in Udemy for Business
Building Real-Time REST APIs with Spring Boot - Blog App
Available in Udemy for Business
Building Microservices with Spring Boot and Spring Cloud
Available in Udemy for Business
Java Full-Stack Developer Course with Spring Boot and React JS
Available in Udemy for Business
Build 5 Spring Boot Projects with Java: Line-by-Line Coding
Testing Spring Boot Application with JUnit and Mockito
Available in Udemy for Business
Spring Boot Thymeleaf Real-Time Web Application - Blog App
Available in Udemy for Business
Master Spring Data JPA with Hibernate
Available in Udemy for Business
Spring Boot + Apache Kafka Course - The Practical Guide
Available in Udemy for Business
Comments
Post a Comment
Leave Comment