Setup and use Play framework 2.1 in Scala IDE 3.0

Setup and use Play framework 2.1 in Scala IDE 3.0

What is in this guide?

This guide will show you how to configure a Play web application to import it in Scala IDE, how to configure Scala IDE to work fine with the Play framework and finally how to develop Play web application from inside Scala IDE.

Installing the Scala IDE Play2 plug-in

The Scala IDE Play2 plug-in provides
first-class support for Play2 Route and Template files in Eclipse, for both Java and Scala
projects. In practice, what this means is that many of the features your are used to having
in the Scala or Java Editor (e.g., syntax highlighting, errors-as-you-type reporting, code
completion, hyperlinking) are also available when editing Play2 files.

The Play2 plug-in can be installed via the same Eclipse update-site that you used to install
the Scala IDE. The Play2 plug-in is listed under the Scala IDE plugins group.

For a comprehensive review of the main features available in the Play2 plug-in, please
read the here.

Setting up Play 2.1

To be able to create a Play web application, the Play framework need to be installed. If you have not installed it already, follow this few steps, or use the Play documentation.

Unzip it in your preferred location. Let’s say /path/to/play21 for the purpose of this document.
(from the Play documentation: Running play writes some files to directories within the archive, so don’t install to/opt,/usr/localor anywhere else you’d need special permission to write to.)

For convenience, add the Play folder to your system PATH:

exportPATH=$PATH:/path/to/play21

Creating a Play 2.1 application

In your development folder, ask Play to create a new web application, as a simpleScalaapplication.