ANT_HOME is set incorrectly or ant could not be lo

2019-03-12 04:58发布

This question already has an answer here:

I'm trying to build a project in Ant, using BuildFile (build.xml). Although ANT_HOME environment variable clearly exists and is set to the path where "ant.bat" is located, it always displays this error message. How to configure Ant properly to compile builds in Windows?

Thanks

9条回答
Deceive 欺骗
2楼-- · 2019-03-12 05:53

I've had the same problem, and this is how I resolved it:

Open your ANT directory and check that all the ANT files exist (like directories for bin,lib,etc...) I found my ANT directory was abnormal, just bin was there, the others like lib were missing. (I'm not sure what caused this)

If you have missing files/directories, unzip the apache-ant-1.9.4-bin.zip again, and make sure all the files exist.

查看更多
Animai°情兽
3楼-- · 2019-03-12 05:55

ANT_HOME should be set to the directory where ant is installed. e.g.

If your ant installation is located at: C:\tools\apache-ant

Your ANT_HOME should be set: set ANT_HOME=C:\tools\apache-ant at the System Environment settings and not User Environment Settings

查看更多
Explosion°爆炸
4楼-- · 2019-03-12 05:57

ANT_HOME might be set, but that doesn't mean the path to /bin is in your PATH so the OS can find it.

Add ANT_HOME/bin to your PATH and the OS will be able to find ant.bat.

查看更多
登录 后发表回答