The latest and most recent popular build tool we often hear in Java World is Gradle. This blog covers how to install and configure Gradle build tool, so that we can develop Java Applications using Gradle.
GradleGradle is a build tool that can be used for managing the dependencies, deployment and delivery aspects of an application. Gradle is a combination of Ant and Maven keeping the powerful features of both these two tools together, makes Gradle as flexible and most powerful build tool.
Let us understand how to install and configure Gradle to develop Java Application.
To install and use Gradle we need Java Jdk being installed on our System.
Download the latest version of gradle from the release site. https://gradle.org/releases/
- Download Gradle
- The latest version of gradle is 4.1 once you downloaded it using the above link you get a file with name gradle-4.1-bin.zip.
- copy the above gradle-4.1-bin.zip into the c:\> drive and extract it.
- You should see a folder gradle-4.1 directory under the c:\> drive
- Delete the zip file after extracting
Now configure the windows environment variables as below.
- Create a Environment Variable JAVA_HOME pointing to Jdk Installation directory for e.g. JAVA_HOME to C:\Program Files\Java\jdk1.8.0_131
- Add the Jdk directory to the PATH as %JAVA_HOME%\bin
- Create Environment Variable GRADLE_HOME pointing to the root directory of the Gradle as follows GRADLE_HOME = C:\gradle-4.1
- Now add the GRADLE_HOME\bin to PATH variable of your system as %GRADLE_HOME%\bin
This should display the gradle version, indicates as successful installation of Gradle.