I was in denial for a while but now I get why Rails is so good.
play runwill start the local (Netty) server and your app will be available at localhost:9000.
play ~runwill start the local server and reload it automatically every time you change a file of you app, that way you don’t need to hit refresh (F5) on your browser.
- Useful tip: If you don’t want to have to worry about applying evolutions each time you restart Play, add
applyEvolutions.your_database_name=trueto your application.conf file. For instance, considering the default database, you should add
Debugging using Eclipse
- First you must start the Play! app in debug mode by executing the command
play debug run.
- On Eclipse add your breakpoints as you would normally do.
- Then go to
Run > Debug Configurations...and double-click
Remote Java Application. This will add a new configuration.
Connection propertiesand change
Debugso that it later appears below the Debug icon. Click
That’s it! Check this video for a live explanation.
Follow the official install instructions (these steps will only work for 2.1.* versions of the Play Framework). Afterwards:
play new myFirstAppcreates a new app, in the current directory, inside a new folder called
- Now try to run it. First go inside that folder (
cd myFirstApp), and run it (
- [Optional step] You can transform your Play application into an Eclipse project, by running
play eclipse. If you want Play’s source files and javadoc to be attached to the Eclipse project, you should execute
play "eclipse with-source=true"instead.