Getting Started with Play
Create a java project
- Download the latest play 2.0 zip from http://playframework.org
- Extract the zip file to a convenient location. Usually, I extract and put it in my c:\, so that it is easily accessible from the command prompt.
- Add the play framework path in your PATH environment variable.
- Open command prompt and 'cd' to your project folder.
- Enter 'play new learn-play' from your project folder (where learn-play is the name of your first project).
- This will prompt for what language template. Pick option 2, which is 'simple java application'
- This will create a simple java application template. Look for 'OK, application learn-play is created. Have Fun!' message.
Run your application
- Open command prompt and 'cd' to your project folder. Then 'cd' to learn-play folder.
- Run 'play' from the command prompt.
- This will show the '[learn-play]$' command prompt.
- Enter 'run'
- This will run the play application in development mode.
- From the browser enter 'http://localhost:9000' will run the application.
Create Eclipse Project
- From the play '$' prompt, enter command 'eclipsify'
- This will create an eclipse project.
- From eclipse, right click and choose Import->Existing Projects into Workspace and browse to your lean-play folder.
- This will open your learn-play project.
- Whenever you install a new module, you have to re-run the 'eclipsify' command
Reference
No comments:
Post a Comment