开发者

Debugging a runnable groovy class via IntelliJ

开发者 https://www.devze.com 2023-01-20 22:59 出处:网络
I\'m successfully debugging this script in Intellij: println \"a\"; println \"b\"; 开发者_如何学运维

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.


FYI this bug is fixed in IDEA 11.1


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..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号