简体   繁体   English

无法识别命令行Ant

[英]Command line Ant not recognised

** Edit ** I have summarized the solutions I found to this problem in this post. **编辑**我总结,我发现这个问题的解决方案, 这个职位。

I am installing Android into Eclipse which I have been using for Java for 2 years. 我正在将Android安装到已使用Java 2年的Eclipse中。 As part of this I have installed Ant and also upgraded to JDK1.7.0 作为此过程的一部分,我已经安装了Ant,还升级到了JDK1.7.0。

Per the Cordova get started guide , I now run command line tests by typing java to see if it is recognized, then ant. 按照Cordova入门指南 ,我现在通过键入java来运行命令行测试,以查看它是否被识别,然后被ant识别。

  • java is recognized (thanks to Nikolay Ivanov's help in a previous question) 可以识别Java(感谢Nikolay Ivanov在上一个问题中的帮助)
  • ant fails to recognise anything 蚂蚁无法识别任何东西

I have ANT_HOME set to "c:\\Developer\\apache-ant-1.8.4" 我已将ANT_HOME设置为“ c:\\ Developer \\ apache-ant-1.8.4”
My PATH variable includes "%ANT_HOME%\\lib". 我的PATH变量包括“%ANT_HOME%\\ lib”。
I have also tried %ANT_HOME%\\bin and %ANT_HOME%. 我还尝试了%ANT_HOME%\\ bin和%ANT_HOME%。
The ant.jar file is in c:\\Developer\\apache-ant-1.8.4\\lib ant.jar文件在c:\\ Developer \\ apache-ant-1.8.4 \\ lib中

But "ant" on the command line is still un-recognised. 但是命令行上的“ ant”仍然无法识别。

FWIW, I now restart my command line interface every time I make a change in my environmental variables... FWIW,现在我每次更改环境变量时都重新启动命令行界面...

** Edit, I have removed %ANT_HOME%\\bin from my build path and replaced it with "C:\\Developer\\apache-ant-1.8.4\\bin". **编辑,我从构建路径中删除了%ANT_HOME%\\ bin并将其替换为“ C:\\ Developer \\ apache-ant-1.8.4 \\ bin”。

I now have a new error "Buildfile: build.xml does not exist! Build failed" 我现在有一个新错误“ Buildfile:build.xml不存在!构建失败”

路径应包含%ANT_HOME%\\ bin,但不应包含%ANT_HOME%\\ lib。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM