问题
I am new to Framework 2.0. In Play 1.0, after you Eclipsify your project, you have have a *.launch file that you can use to launch your project.
After you eclipsify in Play 2.0, you don't seem to have anything similar. Is there a way to control your launching and to debug Play 2.0, using Eclipse?
A similar question: Debug Playframework 2.0 in Eclipse
The answer to that question did not have specific enough instructions for me to know how to follow.
回答1:
Question 1:
After you have eclipsified, open Eclipse and choose File -> Import... -> Existing Projects into Workspace. A dialog will open, choose your Play Framework 2.0 project folder and click Finish.
Question 2:
Start your Play Framework application using
play debug run. You will see something like this:Listening for transport dt_socket at address: 9999 ...
In Eclipse, right-click on your project in
Project Explorerand chooseDebug As -> Debug Configurations....A new dialog called
Debug Configurationswill open. Double-click onRemote Java Applicationand a new window will appear on the right side. Change theConnection propertiesso that the point to hostlocalhostand port9999. Confirm by clicking theDebugbutton.Put a breakpoint in your Application in Eclipse.
Try your application as normal in a web-browser. If it hits a breakpoint then Eclipse will be brought as frontmost and let you debug.
来源:https://stackoverflow.com/questions/10038673/using-eclipse-with-play-framework-2-0