2
votes

** 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. As part of this I have installed Ant and also upgraded to 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.

  • java is recognized (thanks to Nikolay Ivanov's help in a previous question)
  • ant fails to recognise anything

I have ANT_HOME set to "c:\Developer\apache-ant-1.8.4"
My PATH variable includes "%ANT_HOME%\lib".
I have also tried %ANT_HOME%\bin and %ANT_HOME%.
The ant.jar file is in c:\Developer\apache-ant-1.8.4\lib

But "ant" on the command line is still un-recognised.

FWIW, I now restart my command line interface every time I make a change in my environmental variables...

** Edit, I have removed %ANT_HOME%\bin from my build path and replaced it with "C:\Developer\apache-ant-1.8.4\bin".

I now have a new error "Buildfile: build.xml does not exist! Build failed"

1
did you restart your system after the settings? some times reboot can help you - Festus Tamakloe
@Festus No I haven't. I'll report back in a few minutes... - Matt Stevens
@Festus No effect, ant is still not recognised. Path is set to %ANT_HOME%\bin and echo %ANT_HOME% generates "C:\Developer\apache-ant-1.8.4". - Matt Stevens
try to download a new ant may be there is bug in your actual version - Festus Tamakloe
No change. And I restarted my PC as well. I just tried putting the full name in the PATH variable "C:\Developer\apache-ant-1.8.4\bin" and that created a new error message, "Buildfile: build.xml does not exist! Build failed" - Matt Stevens

1 Answers

1
votes

Path should include %ANT_HOME%\bin but not %ANT_HOME%\lib.