Gradle also works with many of the popular IDE platforms available today, including, Android Studio, Eclipse, IDEA, and NetBeans. For more about Gradle, please visit its homepage. This brief tutorial is going to show students and new users how to install Gradle Build Tool on Ubuntu 16.04 | 18.04 and 18.10 systems. To get started installing Gradle on Ubuntu systems, follow the steps below:
Install Java JDK
Gradle needs Java JDK installed on Ubuntu. It requires Java JDK 7 and above. however, Java JDK 8 is much more stable and supported across many platforms. For this tutorial, we’re going to be installing OpenJDK 8 on Ubuntu. To install OpenJDK 8, run the commands below After that, run the commands below to print out the version of Java installed. You should see similar content as shown below:
Install Gradle
Now that OpenJDK 8 is installed, run the commands below to download Gradle version 4.10.2 in the /tmp. At the time of this writing, the version is 4.10.2 After that, extract the content into the /opt directory. Gradle should be extracted to the /opt/gradle/gradle-4.10.2 directory. You will want to keep the version separate so you can upgrade easily. In the future, all you need to do is create a symbolic link to the version folder to use that version.
Configure Ubuntu Environment Variables
Now that you’ve extracted Gradle content, go and configure Ubuntu environment variables to use Gradle. You can do that by running the commands below to create a new file called gradle.sh in the /etc/profile.d directory. They copy and paste the lines below into the file and save. When you’re done, run the commands below to make the file executable. That’s it! You should be able to use Gradle on Ubuntu. To print out the Gradle version and info sheet, run the commands below That should print out its info as shown below: Enjoy! Conclusion: You have learned how to successfully install Gradle Build Tool on Ubuntu 16.04 | 18.04 and 18.10 systems. You may also like the post below: