This recipe will guide you through installing Play Framework 2.3 for local development. This section will guide you on the prerequisite installations for Play Framework, such as the Java Development Kit (JDK), and the necessary steps to ensure that Play Framework has access to the JDK's binaries.
Play Framework requires a JDK version of 6 or above. Head over to the Oracle website and download the appropriate JDK for your development machine at http://www.oracle.com/technetwork/java/javase/downloads/index.html.
Once you have downloaded a suitable JDK, ensure that the binary folder is added to the system path:
$ export JAVA_PATH=/YOUR/INSTALLATION/PATH $ export PATH=$PATH:$JAVA_HOME/bin
You can also refer to Oracle's online documentation for more information regarding setting environment variables at http://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/index.html.
Here's how you can verify that the JDK is now accessible in the system path:
$ javac -version javac 1.7.0_71 $ java -version java version "1.7.0_71" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
As of Play 2.3.x, Play is now distributed using a tool called Typesafe Activator (http://typesafe.com/activator), install it using following steps:
Download the Typesafe Reactive Platform distribution at https://typesafe.com/platform/getstarted and unzip it at your desired location that has write access.
After downloading and unzipping the distribution, add the
Activator
installation directory to your system path:$ export ACTIVATOR_HOME=</YOUR/INSTALLATION/PATH> $ export PATH=$PATH:$ACTIVATOR_HOME
Now, verify that Activator is now accessible in the system path:
$ activator --version sbt launcher version 0.13.5
You should now be able to create a Play application using the
activator
command:$ activator new <YOUR_APP_NAME>