Open a Play Project in Eclipse
To turn the Pay project into an Eclipse project, run activator to launch the console. Inside the console, executeeclipse with-source=true
The last argument is optional, downloading the source code of used libraries.
After importing the project into eclipse, you can verify that
target\scala-2.11\classes-managed
is added to Java Build Path > Libraries.
During the development process, you may run into IDE problems like eclipse not recognizing your view classes. They generally can be resolved by re-running the eclipse command and then refreshing the eclipse project.
Remote Debug
Launch the Play application with remote debugging enabled asactivator -jvm-debug run
This uses the default port number 9999 for remote debugging. Alternately, you can be explicit about the port number:
activator -jvm-debug 9999 run
Afterwards, you can attach eclipse via remote debugging. From Run > Debug Configurations ...
The tricky thing is that activator may launch the application by forking another JVM. As a result, I was remote debugging activator instead of the launched Play application. This left me baffled for quite a while: Eclipse attached correctly, but none of the breakpoints worked.
One easy workaround is to turn off the forking. Open build.sbt, set
fork in run := false

1 comment:
Thanks for mentioning => fork in run := false property. I was making this mistake.
Post a Comment