Play! 1 & 2 command tip

If you love the Play! Framework, you might be like me and have both version 1.x and 2.x installed.

Version 1.x, in my case 1.2.4, is a well established feature rich stable version. 
Version 2.x, in my case 2.0, is a new radically different version, that is still in its infancy but released. 

You might have both installed as you have older projects using 1.x and new in development projects using 2.x, or similar.

With both version the norm is to install them and expose the main executable as "play". So how do you differentiate between which version to use for which project?

OK, it is no rocket science but here is a quick tip on how I do it:

I have Play! 1.x installed in

I have Play! 2.x installed in /usr/local/lib/play-2.0

You can add either play folders to the your PATH, e.g. in /etc/environment: 


But I simple add them to my .bash_aliases file:

alias play1="/usr/local/lib/play1/play"
alias play2="/usr/local/lib/play2/play"

On top of that I symlink this:

$: cd /usr/local/lib;
$: sudo ln -s play-1.2.4 play1;
$: sudo ln -s play-2.0 play2

With this setup I have to make a conscious decision whether to run Play! 1 or 2, and can switch between the two very easily.

$: play1 help;
$: play2 help

Creative Commons License

Unless otherwise specified, all content is licensed under Creative Commons by Attribution 3.0 (CC-BY).

Externally linked images and content are not included and are licensed and copyrighted separately.