How to debug Play application

There seems to be extensive documentation for debugging Play applications with IntelliJ IDEA, but they all assume that Play is built with SBT.

Debugging with Gradle should be as easy as:

  • Set some breakpoints
  • Run GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9999" gradlew --no-daemon :runPlayBinary
  • Run an IntelliJ Remote Configuration to attach to the Gradle process
  • Hit http://localhost:9000 and do something interesting to cause a breakpoint to be hit

The problem Iā€™m having is: the breakpoint is never hit, processing continues as normal. Technologies: Play 2.3.X, IDEA 14.1, Gradle 2.8, Scala 2.10

I must be missing something, what is it?

1 Like

I got this to work with:

-Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9999

IntelliJ actually gives you the params when you setup the Remote Debugging configuration