i am not an experienced person using ant, but have done a few projects using ant to build.
Upto my knowledge ant must be either provided the specific target in our build.xml or run the ant directly in build.xml without any argument.
But now I am facing a peculiar error which i get when i run ant
Please post you build script. As far as I can tell from the error the term 'and' is appearing in an unusual location. Also, post the full command line you entered and all of the output that was generated (copy and past the whole thing from the command line to the forum).
what ever the build file i use or which ever the target i give to the command ant, it is just throwing the message
and was unexpected at this time.
actually i am able to run the file properly through my IDE, but when i do it directly in a command prompt i am facing the error.
I tried even to remove the existing ant binaries and downloaded the new ones but still i am getting the same.
Ant is run via a batch file named ant.bat. Apparently someone edited that file and screwed it up. Either fix it, or reinstall ant. Another possibility is env var settings - if any JAVA_HOME has quotes then that could cause issues. The best way to find out the exact issue is edit ant.bat and comment out the "@echo off" at the start of the file, then when you run ant it will echo all of the command in ant.bat until it hits the place where it was messed up.
Joined: Dec 02, 2009
@ Peter Johnson
What a great point
Peter Johnson wrote: The best way to find out the exact issue is edit ant.bat and comment out the "@echo off"
It did helped me where i made the mistake, it was the variable CLASSPATH which contains "" and that's where it messed up the whole thing.