Debug Java program by executing “gradle run”

To debug a gradle project in eclipse follow these steps:

step1: Put these in the build.gradle file:

      

step2:

From root of your project run:

      

Now in console you will see something like this:

      

step3:

Now set breakpoints in eclipse in your codes.

step4:

Now from eclipse right click on your project>debug as>debug configuration>Remote java application set these fields:

      

Click "debug". Now your program will stop whenever it hits a breakpoint in eclipse.

To see details of these steps with an example project see more here: