Gradle Tutorial : How to build and run a Java Application


Video is ready, Click Here to View ×

In this Gradle tutorial, we learn how to build and run a simple Java application using Gradle. We create a Java project using Notepad and then build and run it with the help of Gradle.

For steps theory or detail, please refer Tech blog:

Tech Blog :
Facebook :
Twitter :
Google+ :
Pinterest :…

21 thoughts on “Gradle Tutorial : How to build and run a Java Application

  1. I have question as follows-
    How to configure the build.gradle as to run th
    e program of the project?
    Example- If i have project called planet in which package is earth followed by class country which is runner class to the project.

    Now can we do something to call/declare this calls in build.gradle so when we run build.gradle it will ready our package and automatically start running the country class.

    I would really appreciate if you can answer this for me.

  2. Simple and nice tutorial.. Thanks.
    I was facing issue building with external dependency due to proxy setting.
    Created with below entry solved the issue.
    systemProp.http.proxyHost=<http proxy host>
    systemProp.http.proxyPort=<http proxy port>
    systemProp.https.proxyHost=<https proxy host>
    systemProp.https.proxyPort=<https proxy port>

  3. Thank you very much for the video. I could reach upto build.gradle. Later, when I tried to check gradle tasks in command prompt the following error message is returned. Kindly help.
    error message :

    C:TL ProjectsGradleDemo>gradle tasks

    FAILURE: Build failed with an exception.

    * Where:
    Build file 'C:TL ProjectsGradleDemobuild.gradle' line: 1

    * What went wrong:
    A problem occurred evaluating root project 'GradleDemo'.
    > Could not find method aplly() for arguments [{plugin=java}] on root project 'GradleDemo' of type org.gradle.api.Project.

    * Try:
    Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output.

    * Get more help at

    BUILD FAILED in 0s

Leave a Reply

Your email address will not be published. Required fields are marked *