1
votes

I am trying to debug a groovy project using debug as Groovy Script, but Eclipse is not stopping on the line. I have set a breakpoint on line 2, restarted Eclipse, cleaned and "Skip all Breakpoints" is not checked. This is the code, and it does execute. Any help would be appreciated.

def sum = 3 + 5
println "the sum is " + sum

Environment

  • Windows 8.1
  • JDK 8u31
  • Eclipse Luna SR1 (4.4.1)
  • GGTS 3.6.3.SR1
2

2 Answers

3
votes

The script ran just fine, but it seems the debugger couldn't find it because it was missing the package directive in the script, as the file was nested under a package name.

package MyNamespace
def sum = 3 + 5
println "the sum is " + sum
1
votes

Check to see if 'Stop in main' is selected in Run > Debug Configurations.

Check if the code you're running is in fact the one in the editor as Eclipse sometimes build classes that are out of sync with the code in the editor.

If you recently updated anything, make sure the project is using the correct library as the debugger can get confused if there are multiple versions of the same library.