[英]setting up environment variables in windows 7 for java and ant
I have a book that says to do the following. 我有一本书说要做以下事情。
When I then go to the command prompt and try ant -version it says ant is not a recognized command. 当我然后转到命令提示符并尝试ant -version时,它说ant不是一个公认的命令。 If I then take the value I plugged into the ANT_HOME variable and use it in place of $ANT_HOME it all works. 如果我接下来我插入ANT_HOME变量的值并使用它代替$ ANT_HOME它一切正常。 Is this the way it's supposed to work in windows? 这是它应该在Windows中工作的方式吗? I'm not sure so I just figured that whatever was put in ANT_HOME was then parsed in the path variable when used as $ANT_HOME. 我不确定所以我只是认为放在ANT_HOME中的任何内容在用作$ ANT_HOME时都会在路径变量中解析。 Thanks. 谢谢。
you can try the following: 你可以尝试以下方法:
SET ANT_HOME=my_path_to_ant_folder
SET JAVA_HOME=my_path_to_jdk_folder
SET PATH=%PATH%;%ANT_HOME%/bin;%JAVA_HOME%\bin;
Now you can define an environment variable, type JAVA_HOME in Variable name and in Variable value the path to you JAVA_HOME, the same thing goes for ANT_HOME . 现在您可以定义一个环境变量,在Variable name中键入JAVA_HOME ,在Variable Value中键入JAVA_HOME的路径,对于ANT_HOME也是如此 。
$ANT_HOME doesn't mean $ANT_HOME, literally. $ ANT_HOME并不意味着$ ANT_HOME,字面意思。 $ANT_HOME means "the value of ANT_HOME". $ ANT_HOME表示“ANT_HOME的值”。
If Ant is installed at c:\\ant
, your environment variables should be: 如果在c:\\ant
安装了Ant,则您的环境变量应为:
ANT_HOME=c:\\ant
PATH = ...;c:\\ant\\bin;...
Same for JAVA_HOME. JAVA_HOME也是如此。
Right click on My computer and select properties. 右键单击我的电脑,然后选择属性。
Click on Advance system settings. 单击高级系统设置。
Visit http://codebrizz.blogspot.com.ng/2016/07/installation-and-configuration.html for full configuration guide with images for each step 访问http://codebrizz.blogspot.com.ng/2016/07/installation-and-configuration.html获取完整配置指南,其中包含每个步骤的图像
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.