1

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 Answers 2

3

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

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.

1
  • The comment on the being out of sync with the editor helped me realize the answer. The script file was under a package and I didn't have the package directive in the script.
    – scottrudy
    Feb 17, 2015 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.