Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
After the installation of ant in windows 7 . In cmd i typed
HTML
ant -version;
it's given the ant version.

HTML
C:\Users\lcladmin>ant -version;
Apache Ant(TM) version 1.9.1 compiled on May 15 2013


Then I typed
HTML
ant -f build.xml;
and it gave me following error.

HTML
C:\Users\lcladmin>ant -f build.xml;
Buildfile: build.xml does not exist!
Build failed


What the reason for that? I placed build.xml file in the eclipse project's build folder.

buid.xml path-> D:\workspace\BankDemo\build\build.xml

ant path->D:\ant
Posted
Updated 14-Jul-13 18:32pm
v2

1 solution

The directory "C:\Users\lcladmin" seems to be the context where ant is running, and therefore where ant would expect the build.xml file to exist.

I think if you want it to be seen in the eclipse project's build folder, you need to activate it from the Eclipse IDE. You are attempting to run from the command line, which is a different context...
 
Share this answer
 
Comments
mali_angel 15-Jul-13 1:53am    
Can You explain this.I'm new to ant and java...
H.Brydon 15-Jul-13 11:22am    
You didn't say what platform you are on - I will assume some sort of Windows. For any command (ant or otherwise), you need to be able to identify the filename passed as parameter. Finding the build.xml from ant is no different from any other command (eg. "dir", "copy" etc.). If your build.xml is in another directory, then 'cd' there.

cd /d D:\workspace\BankDemo\build
dir build.xml
ant -f build.xml;

I haven't used ant from command line myself. I always use it from the Eclipse IDE. I would suggest that it might also work better there.
Shubhashish_Mandal 15-Jul-13 2:21am    
+ if you using default build.xml file and if its residing in the current directory then no need to type the build file name with the ant command , simply type ant command.
If still not working then check whether you set the ant home/lib/class path properly.
Shubhashish_Mandal 15-Jul-13 11:28am    
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-84_run_ant.htm

try this..
mali_angel 17-Jul-13 5:17am    
Thank u guyz. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900