ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Can't get <exec> to work
Date Thu, 04 Oct 2001 17:18:01 GMT
If you're running 1.3, it could be the antRun line-endings problem. See:

  http://jakarta.apache.org/ant/faq.html#remove-cr

Or it could be that 'dir' is a Windows built-in -- I think there was a
discussion awhile back about that being a problem (check the ant-user
archive). Consider trying it with a different command.

Diane

--- Chris <chris@ooc2000.com> wrote:
> 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
> 


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

Mime
View raw message