Downloading and installing the Play framework

This recipe will help you to install the Play framework as quickly and unobtrusively as possible in your current system.

Getting ready

All you need is a browser and some basic knowledge about unzipping and copying files in your operating system. Also be aware that you can install Play on Microsoft Windows, Linux as well as Mac OS X or even BSD.

How to do it...

Open up a browser and go to http://www.playframework.org/download and download the most up-to-date stable version http://download.playframework.org/releases/play-1.2.zip (at the time of writing this recpe play 1.2 was the latest stable version).

After downloading it, unzip it, either with a GUI tool or via command line zip:

unzip play-1.1.zip

If you are using Linux or MacOS you might want to put the unzipped directory in /usr/local/ in order to make Play available to all the users on your system; however, this is optional and requires the root access on the particular system:

mv play-1.1 /usr/local/

As a last step adding the Play binary inside the play-1.1 directory to the PATH environment variale is encouraged. This is easily possible with a symlink:

ln -s /usr/local/play-1.1/play /usr/local/bin/play

If you enter play on your commandline, you should get an ASCII art output along with some help and, most importantly, the version of Play you just called. If you do not want to create a symlink, you can also copy the Play binary to a path, which is already included in the PATH variable. In the preceding example you could have copied it to /usr/local/bin.

How it works...

As just mentioned, Play would also work by just unzipping the Play framework archive and always using the absolute path of your installation. However, as this is not very convenient, you should put your installation at the defined location. This also makes it quite easy for you to replace old Play framework versions against newer ones, without having to change anything else than the created symlink.

If you are on a Linux system and you do not see the ASCII art output as mentioned some time back, it might very well be possible that you already have a Play binary on your system, installed. For example, the sox package, which includes several tools for audio processing, also includes a Play binary, which surprisingly plays an audio file. If you do not want to have this hassle, the simplest way is just to create the symlink with another name such as:

ln -s /usr/local/play-1.1/play /usr/local/bin/play-web

Now calling play-web instead of play will for sure always call the Play framework specific script.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.114.28