ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Pirsch ...@javatips.net>
Subject Re: Problem with the exec task
Date Sat, 16 Sep 2000 02:09:50 GMT
I think it's because you cannot execute internal DOS command.

You can try : <exec executable="command /c dir"/> or <exec
executable="cmd /c dir"/>



David Bennett/Toronto/IBM wrote:
> 
> I'm having trouble using the exec task. I've tried testing it with very
> simple targets, but it fails every time.
> I've tried using the August 24 and the September 4 nightly builds of Ant.
> I'm on NT with jdk1.2.2.
> 
> Has anyone else had trouble with this?
> 
> The buildfile:
> 
> <project name="exec_test" default="go">
>      <target name="go">
>           <exec executable="dir"/>
>      </target>
> </project>
> 
> The log output:
> 
> E:\vaj_nl_rtn\build\buildfiles\vaj_nl_rtn\1.0>ant -buildfile exec_test.xml
> Buildfile: exec_test.xml
>      [exec] The command attribute is deprecated. Please use the executable
> attribute and nested arg elements.
> 
> go:
> 
> BUILD FAILED
> 
> exec_test.xml:3: Execute failed: java.io.IOException: CreateProcess: dir
> error=2
> java.io.IOException: CreateProcess: dir  error=2
>         at java.lang.Win32Process.create(Native Method)
>         at java.lang.Win32Process.<init>(Win32Process.java:64)
>         at java.lang.Runtime.execInternal(Native Method)
>         at java.lang.Runtime.exec(Runtime.java:272)
>         at org.apache.tools.ant.taskdefs.Execute.exec(Execute.java:240)
>         at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:218)
>         at
> org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:213)
>         at
> org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:154)
>         at org.apache.tools.ant.Target.execute(Target.java, Compiled Code)
>         at org.apache.tools.ant.Project.runTarget(Project.java:721)
>         at org.apache.tools.ant.Project.executeTarget(Project.java,
> Compiled Code)
>         at org.apache.tools.ant.Project.executeTargets(Project.java,
> Compiled Code)
>         at org.apache.tools.ant.Main.runBuild(Main.java, Compiled Code)
>         at org.apache.tools.ant.Main.main(Main.java:124)
> 
> Total time: 1 seconds
> 
> David Bennett
> 416.448.2630
> IBM Toronto Lab - Visual Age for Java - ID
> dbennett@ca.ibm.com
	
-- 
Emmanuel Pirsch
ETX Solutions, an @gti company
Sun Certified Java Programmer
Unite for Java! - http://www.javalobby.org/
---
"The intuitive mind is a sacred gift and the rational mind is a
faithful servant. We have created a society that honors the servant
and has forgotten the gift."
	- Albert Einstein.

Mime
View raw message