问题描述
我和这个用户有同样的问题:ant - 未被识别为内部
I have the same issue as this user: ant - not recognized as an internal
但是不幸的是,在那篇文章或任何其他文章中,没有一个解决方案对我有用.我还查看了其他无法识别的命令,并专门添加了路径变量.我使用的程序如下:
however unfortunately none of the solutions have worked for me in that post or any other. I've also looked at other commands not recognized and specifically adding a path variable. The procedure I am using is as follows:
Extract to a desired installation directory, e.g. C:\apache-ant
Create an ANT_HOME environment variable`
Open System Properties -> Advanced -> Environment Variables
Create a new system variable
Variable name: ANT_HOME
Variable value: C:\apache-ant
Add %ANT_HOME%\bin directory to the PATH system variable
Open System Properties -> Advanced -> Environment Variables
Under system variables, select PATH and append ;%ANT_HOME%\bin
e.g. %SystemRoot%\system32;%SystemRoot%;%JAVA_HOME%\bin;%ANT_HOME%\bin
Verify that ANT is installed.
Open a new command window and type:
C:\>ant -v`
在我的例子中,变量值是 C:\apache-ant\apache-ant-1.8.2
.
In my case the Variable value is C:\apache-ant\apache-ant-1.8.2
.
我的确切路径变量是 %SystemRoot%\system32;%SystemRoot%;%JAVA_HOME%\bin;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;%ANT_HOME%\bin
分号之间没有任何空格.
My exact path variable is %SystemRoot%\system32;%SystemRoot%;%JAVA_HOME%\bin;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;%ANT_HOME%\bin
which doesn't have any spaces between semicolons.
但是测试蚂蚁安装不起作用,下图是我遇到的:
However testing the ant installation does not work, the picture below is what I'm experiencing:
我多次尝试重新启动都无济于事.我的想法已经用完了,所以如果有人有任何信息会有所帮助.谢谢!
I have tried restarting on numerous occasions to no avail. I have run out of ideas, so if anyone has any any information would be helpful. Thanks!
dir 的发布结果:
推荐答案
ANT_HOME
未解决.将Path系统环境变量中的%ANT_HOME%\bin
改为c:\apache-ant\apache-ant-1.8.2\bin
.
ANT_HOME
is not being resolved. Change %ANT_HOME%\bin
in the Path system environment variable to c:\apache-ant\apache-ant-1.8.2\bin
.
这篇关于“ant"不被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!