Heard that Twitter, Foursquare and Typetalk are running on Play Framework, written in Java and Scala. I’ll try it with Scala IDE for Eclipse which is installed on my MacBook Air.
Play Framework is an open source, makes it easy to build web applications with Java and Scala.
My setup is Mac OS X 10.9.2, Java 1.8.0_05, Scala 2.11, and Eclipse 4.2 (Juno) with Scala IDE 3.0.
If you don’t install Eclipse and Scala IDE, read Setting up Scala IDE for Eclipse.
Let’s Play!
Installing Play Framework 2.2 on Mac
Run this command.
brew install play
Installing the Play2 support in Scala IDE
Open installing new software window.
Then, select the download site of Scala IDE, check the Play2 support in Scala IDE, and go to the next screens to validate the plug-in to install. Accept the License, and start the installation.
Creating new Simple Scala Web Application on Play Framework
Run play command.
play new simpleApp
Some source codes are generated. Change directory to the simpleApp, and launch Play.
cd simpleApp play
Then, run the app on Play.
Congrats! The application starts to work, check it: http://localhost:9000. And you can stop the application using ctrl-d.
Generate configuration for Scala IDE for Eclipse
Run ‘eclipse’ command in Play.
Start the application as a auto-reloading mode, using ~ run.
Setting up Scala IDE and Import the Web Application
Open a preference of Eclipse, and configure your Eclipse. Check “Refresh using native hooks of pooling”.
Import the web application, Click “File” from Eclipse’s menu bar, and select “Import”.
Select “Existing Projects into Workspace” on the Import Screen.
Then, fill with your application root path which is you run the command “play new simple App”, go to finish.
Eclipse imports the web application as a project.
Here we go, what kind of web application do you make?