Windows 7 -ANT_HOME is not installed correctly or ant cannot be found. Please set ANT_HOME

enter image description here

Hello everybody,

I set the path ANT_HOME, but when I try to use ant -version I get the error "ANT_HOME is set incorrectly or ant could not be found. Please set ANT_HOME"

Attached Image For Reference.

Help Pls.

+3
source share
3 answers

You have ANT_HOME installed 2 times:

  • as user environment variable ANT_HOME =% ANT_HOME% \ bin
  • as an environment variable ANT_HOME = C: \ ant -apache-1.9.3

Set ANT_HOME = C: \ ant -apache-1.9.3 either as a user variable OR as a system variable, but not both! Then add% ANT_HOME% \ bin to the System Path variable

ANT_HOME Ant = > C:\ant -apache-1.9.3 , JAVA_HOME.
\bin !

Ant cmd:

C:\Users\someuser>ant
Buildfile: build.xml does not exist!
Build failed

= > OK
Ant :

C:\Users\someuser>ant -diagnostics
------- Ant diagnostics report -------
Apache Ant(TM) version 1.9.3 compiled on December 23 2013

-------------------------------------------
 Implementation Version
-------------------------------------------
core tasks     : 1.9.3 in file:/C:/ant193/lib/ant.jar

-------------------------------------------
 ANT PROPERTIES
-------------------------------------------
ant.version: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
ant.java.version: 1.7
Is this the Apache Harmony VM? no
Is this the Kaffe VM? no
Is this gij/gcj? no
ant.core.lib: C:\ant193\lib\ant.jar
...
+9

ANT_HOME, ANT_HOME/bin PATH.

PATH ,

%ANT_HOME%\bin; PATH

ANT bin PATH. ,

+1

Remove the ANT_HOME path variable, the ACTUALLY message says that you need to use the specific project path You cancel it by setting ANT_HOME.

0
source

All Articles