Guide to installing the Play Framework

Source: Internet
Author: User
Tags git client

Prerequisites

To run the Play framework, you need Java 5 or the updated JDK. If you want to build the Play framework from the source code, you need to use the Git source code management client to obtain the source code and build it with Ant.

If you are using the MacOS system, Java is built-in. If you are using a Linux system, make sure that you are using Sun-JDK or OpenJDK but not gcj. Many Linux distributions use gcj as the default Java environment by default ). If you are using a Windows system, download and install the latest JDK package.

Make sure that the Java command can be entered in the command line in the current path.Java-versionCheck ). The Play framework will call the default Java command or call$ JAVA_HOMEJava scripts in the environment variable declaration path.

The command line tool of Play is written in Python. So it should work on any UNIX system, but it must be Python 2.5 or later ). If you are using a Windows system, don't worry. A runtime Python environment is built into the framework.

Download Binary Package

Download the latest Play Binary Package and decompress it. For convenience, you should add the installation directory of Play to the PATH environment variable of the system. If you are in a UNIX system environment, check whether the play script can be run. Otherwise, you can simply execute chmod + x play ). That's all.

Prompt

If you need to re-build the Play framework for some reason, you can execute the ant command under the $ PLAY_HOME/framework directory.

Build with the latest source code

To benefit from the latest improvements and bug fixes of Play, you may want to compile the Play framework directly from the source code. You will need a Git client to obtain the source code and use Ant to build the play framework.

Use the following command line:
 

 
 
  1. # git clone git://github.com/playframework/play.git  
  2. # cd play/framework  
  3. # ant 

In this way, you can use Play.

Use the play command

After correctly installing Play, open a shell and execute play.

 
 
  1. $ play 

You will see the default information of play:

You can usePlay help any-command-name-hereFor more help on this command. For example, try:

 
 
  1. # play help run 

Create an application

Use the new command to create a new application. You need to specify a unique application name in the current path for the new application.

 
 
  1. # play new myApp  

After creating a new application, run the following command to start the application:

 
 
  1. # play run myApp  

You can access http: // localhost: 9000 in a browser and view the default page of the application.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.