views:

20

answers:

1

I'm successfully debugging this script in Intellij:

println "a";
println "b";

But, when trying to debug the following script, my breakpoints aren't hit

public class Main implements Runnable{
  public Main(String[] args) {
    println("A"); // breakpoint
    println "B";

  }

  void run() {
    println "C"; // breakpoint
    println "D";
  }
}

Note that the script does run successfully, just without stopping at breakpoints.

A: 

This is correct main method signature:

static void main(String[] args) {...}

I believe that you should not expect for run() method to execute as you don't actually run it in a separate thread or invoke directly..

denis.solonenko
Groovy will run a Runnable class by itself as the entry point to the script.
ripper234