ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From v...@trilogy.com
Subject Re: Can't get <exec> to work
Date Thu, 04 Oct 2001 17:23:29 GMT
Either use "cmd /c dir" as the command [after breaking the string into 3 
tokens] or other ANT ways of looking up/matching directory contents.

Vlad.


Please respond to ant-user@jakarta.apache.org
To:     ant-user@jakarta.apache.org
cc: 

Subject:        Can't get <exec> to work


Hi all,

I was just messing around with <exec>, with an eye towards using Ant to
take over building some C projects. Here's my simple build file:

<project name="DirAnt" default="init">
         <target name="init">
                 <exec executable="dir"/>
         </target>
</project>

The error I get when I try and run it is below. I've using Windows 2000,
and Sun's JDK 1.3.1.

Any ideas?
Thanks,
Chris

------------ Error message -------------------

P:\dev\lab\ant>ant -buildfile dir.xml
Buildfile: dir.xml

init:

BUILD FAILED

P:\dev\lab\ant\dir.xml:4: Execute failed: java.io.IOException:
CreateProcess: dir error=2
--- Nested Exception ---
java.io.IOException: CreateProcess: dir error=2
         at java.lang.Win32Process.create(Native Method)
         at java.lang.Win32Process.<init>(Win32Process.java:66)
         at java.lang.Runtime.execInternal(Native Method)
         at java.lang.Runtime.exec(Runtime.java:551)
         at java.lang.reflect.Method.invoke(Native Method)
         at
org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:509)
         at 
org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:329)
         at 
org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:228)
         at 
org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:162)
         at org.apache.tools.ant.Target.execute(Target.java:153)
         at org.apache.tools.ant.Project.runTarget(Project.java:898)
         at org.apache.tools.ant.Project.executeTarget(Project.java:536)
         at org.apache.tools.ant.Project.executeTargets(Project.java:510)
         at org.apache.tools.ant.Main.runBuild(Main.java:421)
         at org.apache.tools.ant.Main.main(Main.java:149)

Total time: 0 seconds





Mime
View raw message