- Downloads & prerequistes
- Environment variables
- Be sure to set the environment variables: JAVA_HOME (pointing to your Java SDK dir). "javac" cmd must work.
- And add the following locations to your PATH variable : JAVA_HOME/bin (%JAVA_HOME%\bin)
- Add play cmd to your path (PLAY_INSTALL_dir\bin)
- Add heroku cmd to your path (HEROKU_INSTALL_dir\bin)
- Get and setup Eclipse
- Get classic or Java developper version of Eclipse IDE
- Increase eclise heap size: -Xms512m -Xmx1024m
- Add Scala sdk to eclipse : Help > Eclipse Marketplace > In seach input type "Scala" > Select "Scala IDE for eclipse"
- Create and run your first App :
In Command prompt :
$ play new PROJECT_NAME
$ play eclipse (Transform you app to an Eclipse project)
$ play run
- App started on local server and run at : localhost:9000
- You can also now import the project into eclipse IDE and play with.
- Deploy on Heroku
You need to create a file named Procfile in the root of your project and for Play it should contain :
web: target/start -Dhttp.port=${PORT} -DapplyEvolutions.default=true -Ddb.default.url=${DATABASE_URL} -Ddb.default.driver=org.postgresql.Driver
Add PgSQL driver depedency, specify it into the project/Build.scala file:
val appDependencies = Seq(
"postgresql" % "postgresql" % "8.4-702.jdbc4"
)
- Available Cloud Hosters for Play / Scala applications
- [Clou Foundry] (http://www.cloudfoundry.com)
- [Herokou] (https://www.heroku.com)
- [CloudBees] (http://www.cloudbees.com)
Problème connus :
- windows config env. variable missing "javac" => add java jdk to yout path (eg. java\jdk1.7.x\bin)