为Play添加环境变量!框架 [英] Adding an environment variable for the Play! Framework

查看:105
本文介绍了为Play添加环境变量!框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
安装播放框架

Possible Duplicate:
Installing play framework

我正在尝试安装Play! Windows 7上的Framework.当我在命令行中键入play help时,我会收到消息

I am trying to install the Play! Framework on Windows 7. When I type play help at the command line I get the message

播放"未被识别为内部或外部命令,可操作程序或批处理文件.

‘play’ is not recognized as an internal or external command, operable program or batch file.

它仅在我位于播放目录的路径中时运行.我添加了一个系统环境变量,如此处 .我以前从未使用过环境变量:这应该工作还是我需要做的其他事情?

It only runs when I am in the path of play directory. I added a system environment variable as shown here. I have never use environment variables before: should this work or is there something else I have to do?

推荐答案

您已经到了一半.

现在,您已经创建了存储Play路径的变量,您需要将该变量添加到系统路径中,以便可以从命令行对其进行访问.

Now that you've created the variable that stores the path for Play, you need to add that variable to your system's path for it to be accessible from the command line.

在相同的系统变量列表(新变量所在的位置)中,找到"Path"变量,并添加您为Play框架位置创建的变量名,并用%括起来.

In the same list of system variables (where your new variable resides), find the 'Path' variable, and add the variable name you created for the Play framework location, surrounded by %.

例如,如果您的新变量名为Plat(如屏幕截图所示),则可以将Path变量编辑为如下所示:

For example, if your new variable is called Plat (as your screenshot shows), then you'd edit your Path variable to look something like this:

[previous path element];%Plat%

请记住,分号会分隔路径中的变量,因此,如果需要添加其他变量,请确保在变量的两端都使用分号.

Keep in mind that the semicolon separates variables in your path, so if you need to add additional variables, be sure to use the semicolon on both ends of your variable.

就像FYI一样,您也可以跳过已经完成的步骤(创建新的环境变量),只需将安装Play的路径直接添加到路径中即可:

Just as an FYI, you can also skip the step you've already done (creating a new environment variable) and simply add the path to your installation of Play directly to the Path:

[previous path element];C:\webapp\Play

两个实现都将获得相同的结果;首先创建一个变量只是简化了路径在其他变量中的重复使用.

Both implementations will achieve the same result; creating a variable first just simplifies the re-use of the path in other variables.

这篇关于为Play添加环境变量!框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆