I have a java class and I need to debug it (put breakpoints and continue using F6). I am using ANT script to init, build, deploy and run the code. I am using:
..........
But when I place the breakpoint in a line in my foo.java class and I run the ant script (the run part, Right Click on run-->Debug As-->Ant Build), Eclipse does not stop at that line of code.
What am I missing out?!
解决方案
In the ant task you should add two jvm parameters ( IIRC) to turn on debugging:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5432
This will launch the java program with debugging turned on and the program will be ready to accept debugger connections on port 5432. Then you should use your IDE's remote debugging facility and direct it to connect to port 5432.