ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Goktepe <andrewgokt...@gmail.com>
Subject Re: Result: 1
Date Tue, 23 Aug 2005 02:04:21 GMT
In this case, "Error code 2" would mean that Windows could not locate the 
file in response to Ant's attempt to execute it. That error is returned from 
the OS. 
 Because the file you are trying to run is a batch file, it cannot be run 
directly. It needs to be interpreted by another executable. Try this 
instead:
 <exec executable="cmd.exe" dir="${src.dir}" os="Windows 2000,Windows XP">
 <arg value="run.bat"/>
</exec>
 -Andrew
 On 8/22/05, Dewey, John <jdewey@rsasecurity.com> wrote: 
> 
> Hmm OK. I guess I'm a little confused now. I thought that the return
> codes were determined by the operating system as the ant manual
> http://ant.apache.org/manual/CoreTasks/exec.html said that "error code 2
> means 'no such program'. Is this meaning of error code 2 simply a
> convention that programs follow? Thus a more precise saying would be
> that error code 2 means 'no such program' for most programs.
> 
> Given the error message I'm not sure which program is returning the
> error code since it is complaining that it doesn't recognize / can't run
> the executable I'm trying to execute.
> 
> What I'm trying to do is call a bat file from ant.
> <exec dir="${src.dir}" executable="run.bat" os="Windows 2000,Windows
> XP"/>
> The full error message is
> [exec] 'run.bat' is not recognized as an internal or external
> command,
> [exec] operable program or batch file.
> [exec] Result: 1
> 
> I am sure that run.bat is a bat file. Does what I want it to from the
> command line. It doesn't matter what its contents are it gives the same
> error when all I had is 1 line:
> java proj.client.Client
> 
> I know I could run the above command in a Java task, it is trivial
> because I was trying to eliminate the contents of the bat file as the
> troublemaker.
> 
> -Jon
> 
> -----Original Message-----
> From: Andrew Goktepe [mailto:andrewgoktepe@gmail.com]
> Sent: Monday, August 22, 2005 5:49 PM
> To: Ant Users List
> Subject: Re: Result: 1
> 
> The external program that you called from your Ant script returned a
> value
> of 1. If you're interested in what that error means you'll have to
> examine
> that program. Ant is just relaying it back to you. You could also
> provide
> the calling <exec> task and more of the output if you want to dig
> further.
> -Andrew
> 
> On 8/22/05, Dewey, John <jdewey@rsasecurity.com> wrote:
> >
> > Does anyone know what "[exec] Result: 1" means on windows? I haven't
> > been able to find a listing of error codes for ant.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message