Installing play framework

前端 未结 6 1533
天命终不由人
天命终不由人 2020-12-19 07:03

I am on windows 7 and I am trying to install play framework.

I created the environment variable in system variables with
variable name:

相关标签:
6条回答
  • 2020-12-19 07:32
    1. Open command prompt as administrator
    2. setx PATH "%PATH%;c:\path\to\play" /m <--substitute c:\path\to\play with your path
    3. Re-open new command prompt and you can run play from anywhere
    0 讨论(0)
  • 2020-12-19 07:35

    Muhammad is correct. The only thing I would add is this: After saving the environment variables, I noticed that one must:

    1. close ALL explorer windows
    2. open a new one
    3. open a new cmd prompt

    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...

    0 讨论(0)
  • 2020-12-19 07:50

    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.

    0 讨论(0)
  • 2020-12-19 07:54

    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

    0 讨论(0)
  • 2020-12-19 07:57

    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.

    0 讨论(0)
  • 2020-12-19 07:57

    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.

    0 讨论(0)
提交回复
热议问题