Build Scala In Play Framework
This is not the only post you will find on the internet about it, I create a personal post here more as a personal reference.
Play Framework makes it easy to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly architecture. Built on Akka, Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.
Example is built on mac os x. Scala Project in Play Framework.
Install Scala:
Install: scala-2.10.3 horstmann.com/scala/install
Then, add Scala to Path:
Then use $scala, you shall enter the world of scala >
Install play framework:
You can use the following command:
You can check latest version by:
Or go to the formula file:
https://github.com/mxcl/homebrew/blob/master/Library/Formula/play.rb
Then, add Play to Path:
Play: Create new project:
Step1 Build project:
Step2 Open project:
Step3 Launch:
Then you lanuch your first play app!
You can also use compile/run to start your project:
Step4: Review in browser after server is running:
http://localhost:9000/
(Server started, use Ctrl+D to stop and go back to the console)
Play Plus IDE: (i.e. Eclipse)
Play provides a command to simplify Eclipse configuration. To transform a Play application into a working Eclipse project, use the eclipse command:
without the source jars:
If you want to grab the available source jars (this will take longer and it’s possible a few sources might be missing):
Note if you are using sub-projects with aggregate, you would need to set skipParents appropriately:…or from the play console, type:
Then import from IDE.
Tip: Do not commit Eclipse configuration files when you work in a team!