AkbarAhmed.com

Engineering Leadership

Introduction

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.

YouTube Version

I have created a YouTube video that shows the steps below. You can watch the YouTube video at:

How to attach the Eclipse debugger to a Play Framework 2.0 application (YouTube)

Note: Change the playback quality to 720p with a large window for the best display.

Configure Play

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
commands:

cd Prototyper
play clean compile
play debug run

Configure Eclipse

  • 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.

One thought on “Debug a Play Framework 2.0 application with Eclipse

  1. Joseph Bell says:

    I precisely needed to thank you so much once again. I am not sure what I would have carried out in the absence of the entire ideas contributed by you over that question. It has been a real fearsome crisis in my opinion, however , being able to see a new professional avenue you resolved it forced me to leap for happiness. I am just happier for the advice and thus trust you find out what a great job you happen to be accomplishing instructing the mediocre ones via a blog. More than likely you’ve never met all of us

Leave a comment