Debugging a Play Framework 2.0 application with Eclipse is exceptionally easy to setup. Importantly, using the debugger is integral to developing high quality, complex applications as it provides an easy way to step into your code.
I have created a YouTube video that shows the steps below. You can watch the YouTube video at:
Note: Change the playback quality to 720p with a large window for the best display.
Note: Prototyper is the name of a project that I use for prototyping code. Replace Prototyper with the name of the project that you want to debug.
Open a command prompt (Linux) or PowerShell (Windows), then enter the following
play clean compile
play debug run
- Open Eclipse.
- Select the project (ex. Prototyper) in Navigator in the left pane.
- Select the Run menu, click Debug Configurations…
- In the Debug Configurations dialog box, double-click on Remote Java Application in the left pane.
- In the right pane, a new remote Java application configuration will be created for you. Change the Port to 9999.
- Click Apply.
- Click Debug.
- Add a breakpoint in your Java code by pressing Ctrl + Shift + B.
- Open a web browser to http://localhost:9000 and navigate to the page where the breakpoint will be activated.