Gradle Environment variable setup
Before we start building our applications through command-line with Gradle, the first step would be to setup Gradle in our machine and configure the required environment paths. To do so, follow the below steps –
1. Download the Gradle to your local machine and extract to one of the folders in your file system.
2. Once downloaded, go to My Computer –> properties –> Advanced system settings –> Environment variables.
3. Add new system variable as shown below and click on OK.
4. Edit the PATH variable and append ‘%GRADLE_HOME%\bin;‘ to its value, and click on OK once done. Refer to the below snapshot –
5. We are almost done. To check the proper environment variable setup, run the below command in CMD prompt –
If you see the proper output as in the above snapshot, you are done with the environment variable setup successfully.
Installing Gradle Plugin in Eclipse
Alternatively, we can also build your application using Gradle plugin in Eclipse itself. To do this, we need to install Gradle plugin from Eclipse Marketplace.
Search for ‘gradle’ as shown in the below snapshot and install the plugin named as ‘Buildship Gradle Integration 2.0‘
As I already have the plugin installed, it is not showing the ‘Install’ button for me.
So this is it. We would need to restart eclipse to complete installation.