Test setup: Ant 1.9.4 on Debian Jessie, JRE 1.7.0 Need to pass argument "-f" or "--file" to command line via exec task. All this is not working (called tool reports that an argument without dash, "f" or "file" was called. <arg value="-f"/> <arg value="--file"/> <arg line="-f"/> <arg line="--file"/>
Hmm, seems to work for me. $ cat /tmp/exec.xml <project> <exec executable="uname"> <arg value="-a"/> </exec> </project> $ ant -f /tmp/exec.xml Buildfile: /tmp/exec.xml [exec] Linux brick 3.13.0-39-generic #66-Ubuntu SMP Tue Oct 28 13:30:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Can you please run "ant -v" to see what's going on? For me it says [exec] Current OS is Linux [exec] Executing 'uname' with arguments: [exec] '-a' [exec] [exec] The ' characters around the executable and arguments are [exec] not part of the command. and the dash is there (obviously not only inside the logs) as "uname a" would cause an error.