Follow the official install instructions (these steps will only work for 2.1.* versions of the Play Framework). Afterwards:
play new myFirstApp
creates a new app, in the current directory, inside a new folder calledmyFirstApp
- Now try to run it. First go inside that folder (
cd myFirstApp
), and run it (play
). - [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 executeplay "eclipse with-source=true"
instead.
If during step 2 you get this error:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
You can solve it if you:
- Edit
%PLAY_HOME%\framework\build.bat
script - Remove the command line argument for the command below:
java -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\repository" -Dplay.home="%~dp0." -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\sbt-launch.jar" %*
- Replace with
java -XX:+CMSClassUnloadingEnabled %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\repository" -Dplay.home="%~dp0." -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\sbt-launch.jar" %*