Getting started with Play Framework

Play Framework - Build Modern & Scalable Web Apps with Java and Scala

                  To start the Play with Java, follow the below steps.

Step 1: The current available Play version is 2.4.2. To work with this version, make sure that the JAVA_HOME environment variable is set to JDK8 or more.

set JAVA_HOME=<Path to JDK 8 or more where it installed> for Windows
export JAVA_HOME=<Path to JDK 8 more where it installed> for Linux based

Step 2: Download the Typesafe’s Activator(Tool from Typesafe which will allow the developers to create Play project quickly. It is built on top of SBT). The Activator will be available in two formats. One is minimum downloadable artifact online version and the other one is offline fully downloadable version(suitable for developers with no internet connection). In this tutorial we are going to use minimum online version.

Step 3: Extract the downloaded Activator zip file and add it to PATH environment variable.

set PATH=<Path to extracted activator folder>;%PATH%; for Windows
export PATH=<Path to extracted activator folder>:$PATH: for Linux based
For example,set PATH=D:\My_Learnings\typesafe-activator-1.3.5-minimal\activator-1.3.5-minimal;%PATH%;

Step 4: Now, from the command prompt use the below command to create Play for Java application. There are other options available for activator. To know that, execute activator help command.

activator new Learning_Play_App play-java

Step 5: Now run the Play app which we created in Step 4 and see the default Play UI. From the command prompt, move to the project which we created and execute the below command. When we run the Activator, it will launch the Netty server. To stop the server, use ctrl+D

D:\My_Learnings>cd Learning_Play_App
D:\My_Learnings\Learning_Play_App>activator run

                    First time when you run activator, it will download all the dependencies from the central repository and will take some time to start the Play application. After the application is started on default port 9000, open the browser and send the request to http://localhost:9999 to see the default Play UI as shown below.

 Play Framework Default Page

 

        You are done with your first Play Application creation. In the next article, we will try to understand the Play folder structure and exporting it as our favorite IDE project(Like Eclipse, IntelliJ etc..).

Advertisements

I am Siva Prasad Rao Janapati. Working as a software developer. Has hands on experience on ATG Commerce(DAS/DPS/DCS), Mozu commerce, Broadleaf Commerce, Java, JEE, Spring, Play, JPA, Hibernate, Velocity, JMS, Jboss, Weblogic,Tomcat, Jetty, Apache, Apache Solr, Spring Batch, JQuery, NodeJS, SOAP, REST, MySQL, Oracle, Mongo DB, Memcached, HazelCast, Git, SVN, CVS, Ant, Maven, Gradle, Amazon Web services, Rackspace, Quartz, JMeter, Junit, Open NLP, Facebook Graph,Twitter4J, YouTube Gdata, Bazzarvoice,Yotpo, 4-Tell, Alatest, Shopzilla, Linkshare. I have hands on experience on open sources and commercial technologies.

Tagged with: , ,
Posted in Frameworks, Play
2 comments on “Getting started with Play Framework
  1. Anonymous says:

    I would like to thank you for the efforts you have put in writing this blog.

    I’m hoping to check out the same high-grade blog posts by you later on as well;)

  2. Anonymous says:

    Good information and introduction on Play. Want to see more articles on the same.

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

DZone

DZone MVB

Java Code Geeks
Java Code Geeks
%d bloggers like this: