I have installed ant and it runs successfully in cmd. I know that when you want to use ant, you can enter the destination path and execute ant in command line. This works fine for me. But when I create a batch file to run ant in the destination path. It tells me that ant is not recognized as an internal or external command, operable program or batch file.
So here is what I want to know: how to execute ant in a batch file or is there another way to run it without entering cd command all the time?
"c:\directory\where\ant\is\ant" -buildfile "d:\directory\where\your\build.xml\is\"
call ant -f %BUILDXML_LOC% -lib %ANTUNITLIB_HOME%
The above command must work. Just give it a try.
Where %BUILDXML_LOC% is the location where you have your build.xml file and %ANTUNITLIB_HOME% is the location where you have placed your ant-antunit-1.2.jar and additional jars required
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With