Most convenient way to run/debug applications in intellij IDEA is the following.
Menu command: Run -> Edit Configuration!
Add new configuration -> Application
Then fill up the fields:
Main class:
play.server.Server
VM Parameters:
-Dapplication.path=.
You should have something similar:
If you did it correctly, then you can run and stop your app right from IDE
EDIT for Play! 2
Play 2 has good documentation for debugging. So go read it. But if you want to investigate run/debug buttons method – read further.
It is different for Play 2.
Settings:
Main class:
play.core.server.NettyServer
or
play.core.server.ProdServerStart
VM Parameters:
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999
-Dapplication.path=.
You still can debug your application by pressing debug button but I have not figured out some issues:
-
It always starts in PROD mode, so you can’t make hot code changes.
-
RUNNING_PID. There is an error when you restart your debugging session saying that you have to delete this file.