Reputation: 309
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?
Upvotes: 7
Views: 15736
Reputation: 127
To start a play project, an alternative is to download the activator and create a play project. Download the activator and add it to the environment variable. Open a command prompt and use the following command to create a java project: C:\ activator new project-name play-java If you want to create a scala project C:\ activator new project-name play-scala
Upvotes: 1
Reputation: 342
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...
Upvotes: 10
Reputation: 613
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.
Upvotes: 17
Reputation: 5854
setx PATH "%PATH%;c:\path\to\play" /m
<--substitute c:\path\to\play with your pathUpvotes: 1
Reputation: 921
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.
Upvotes: 3
Reputation: 54944
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.
Upvotes: 3