New Scala Play Project

Before we start we need:

  • activator installed and on our path.
  • a name for the project. I will use my-first-project.

We will do this from the terminal / command prompt.

Creating a new project will create a new folder. We want our command prompt to be one level above this. e.g. if we want to work in /home/vince/projects/my-first-project we need to go to /home/vince/projects.

From here we run the activator command to create a new project:


> activator new my-first-project

The output from this will contain options as to which type of project you want, something like this:

Browse the list of templates: http://typesafe.com/activator/templates
Choose from these featured templates or enter a template name:
  1) minimal-java
  2) minimal-scala
  3) play-java
  4) play-scala

We want option 4 – a play-scala application.

Choosing the option will create a new folder and various files and folders that will give you a “Hello, World” application. A good idea is to create the project file for you favourite IDE – this is the eclipse version but others are found here: http://www.playframework.com/documentation/2.2.x/IDE


> activator eclipse

Now you can Import what you have as an existing project.

To run the project, in the terminal type


> activator run

and go to http://localhost:9000/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s