I am on windows 7 and I am trying to install play framework.
I created the environment variable in system variables with
variable name: play, value: c:\webapp\play\
When I am trying to run play help
from commander it says
play is not recognized as an internal or external command, operable program or
batch file and it is running only in the directory of c:webapp\play.
Am I doing something wrong?
To run the Play framework, you need JDK 6 or later. If you are using MacOS, Java is built-in. If you are using Linux, make sure to use either the Sun JDK or OpenJDK (and not gcj, which is the default Java command on many Linux distros). If you are using Windows, just download and install the latest JDK package.
Play Framework makes it easy to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly architecture. Built on Akka, Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.
sbt : The sbt settings that describe building your application. /conf : Configuration files for your application. /project : Further build description information. /public : Where static, public assets for your application are stored. /test : Where your application's test code will be stored.
To be able to run Play anywhere on the command line, create a PLAY_HOME
environment variable pointing to the play folder, for e.g. c:\play-2.0.1
, and add %PLAY_HOME%
to the PATH
environment variable.
Muhammad is correct. The only thing I would add is this: After saving the environment variables, I noticed that one must:
and then I saw the play_home in the path and play worked everywhere. For some reason, updating the environment variables didn't refresh existing windows.
UPDATE:
If you're in a hurry and feeling rebellious, open a cmd prompt window first, then kill explorer.exe, then restart explorer.exe in the cmd window.
That should refresh everything but be careful...
Here is how I have set it up for others in the past.
Create a directory c:\playframework
Create two more inside of this
framework
and apps
I then have a bat file called env.bat
containing the following
set PATH=%path%;c:\playframework\framework\'
You can then run env.bat
to make sure play is initialise.
I realized that it doesn't work if you have a space in your path to the play framework.
So instead of
C:\Folder with space\PlayFramework
try
C:\FolderWithoutSpace\PlayFramework
This fixed it for me, guess it has to do with the play batch file which doesn't handle paths with spaces correctly. Stumbled upon this question, when searching for a solution, so it might help some other folks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With