Austin Lovell
Austin Lovell

Reputation: 1049

Ant is looking in wrong directory despite having the correct environment variable set

I have my JAVA_HOME set to C:\Program Files\Java\jdk1.7.0_40; which is where it is located. When I run Ant I get this error.

C:\Program Files\apache-ant-1.9.2\bin>ant
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre7\li
b\tools.jar
Buildfile: build.xml does not exist!
Build failed

The jre7 file and the jdk1.7.0_40 files are located right next to each other. Any idea what is going on?

Thank you in advance.

Upvotes: 0

Views: 151

Answers (1)

Buzz Moschetti
Buzz Moschetti

Reputation: 7578

You need to run ant in the same directory as the build.xml file. Alternately, ant -f path/to/build.xml

Upvotes: 1

Related Questions