0

I'm upgrading my ant to 1.9. But after I set the environment variables, this message printed in console: ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.

I found some answers here and did accordingly, but all didn't work.

I tried cd %ANT_HOME% and cd %ANT_HOME%\bin and it shows the correct path, but I can't use ant command even in go to 'ANT_HOME'.

Following is my environment variables:

ANT_HOME: C:\Program Files\apache-ant-1.9.4
PATH: %ANT_HOME%\bin

All set in system variables.

I checked all my settings and have no idea what's happening. Can anyone help with this?

Many thanks.

4
  • In command prompt, type ant -version, what is the output Jan 29, 2015 at 7:30
  • The same error info. I checked the ant.bat file, and traced this error message, found that this leads to here: if not exist "%ProgramFiles%\ant" So I tried to change my ant directory to 'ant', but another error occurs: Failed to locateorg.apache.tools.ant.Main.
    – Sky
    Jan 29, 2015 at 7:48
  • tried rebooting your system..?? Jan 29, 2015 at 8:28
  • @ankur-singhal I rebooted my system. I've posted my answer. Thanks for your help.
    – Sky
    Jan 29, 2015 at 8:31

1 Answer 1

0

It turns out that the zip file I downloaded for ant is not correct. I got another one with .tar.gz as its extension then it works. @ankur-singhal Thanks for your help.

Not the answer you're looking for? Browse other questions tagged or ask your own question.