Reputation: 59
I get following error when I run ant command in cmd prompt
D:\>ant
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li
b\tools.jar
Buildfile: build.xml does not exist!
Build failed
I have to develop a phonegap application for andriod device .
I have set JAVA_HOME
as C:\Program Files\Java\jdk1.6.0_41;
under system variables
and Path
as C:\Program Files\Java\jdk1.6.0_41\bin
in system variables
My ant path is C:\Program Files\apache-ant-1.9.3\bin;
in system variables Path
Values in my Path System variables are as seen below
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;"C:\Program Files\Common Files\EMC";C:\Program Files\Java\jdk1.6.0_41\bin;D:\username-Software\Android\sdk\platforms;D:\username-Software\Android\sdk\platform-tools;C:\Program Files\apache-ant-1.9.3\bin;D:\username-Software\Android\sdk\tools;
Upvotes: 0
Views: 1040
Reputation: 9474
build.xml does not exist:
did you run ant command in directory where build.xml is located? You may create it first - learn how to do it in ant tutorial
tools.jar
: run java -version
. It may happen that some other java have preference in PATH variable. You might need to fine-tune PATH
variable. Java binary is often copied to c:\windows
(aka system32
). Try to add JAVA_HOME\bin
to start of PATH
variable
Upvotes: 1
Reputation: 999
I had the same problem a year ago because i've installed two different JDK that appears in my PATH. check this
"Unable to locate tools.jar" when running ant
Upvotes: 0