Execute failed in Ant

From: Eric Bresie (ebresie_at_usa.net)
Date: 02/19/04


Date: 18 Feb 2004 15:47:03 -0800

Okay...I've seen lots of similar questions but no answers where I've
looked..

I have a build.xml file for ant which does an <exec> command which
runs an executable used in preprocessing of some products.

When I run the executable from a command line, the executable works
fine. When I execute it as part of ant, it fails giving me the
following error:

"Execute failed: java.io.IOException: <path to the execitable>: not
found"

I've heard some people indicate a similar problem is the result of
needing to have the java sdk item listed first in the path. This is
already the case.

I'm thinking maybe this is an environment variable issue. To execute
the preprocessing command under normal circumstances, I run a script
to set environment variables, then run the executable preprocessor.
I think what may be happening is that the environment space used by
ant does not match the environment space of when I call it from the
command line. Is there a way to use the existing environment variable
space from within ant?

Alternatively, could this be a permissions problem on something being
accessed by ant or my preprocessor?

My current build.xml command looks like the following:

<exec dir="${workdir}" executable="${tooldir}/preprocessor
SomeArgument"/>

I am using ant 1.5.3 on a Solaris 8 environment.

Eric



Relevant Pages

  • How to read a remote environment variable when executing commands using SSH
    ... I want to execute a command to a remote computer using ... Some of arguements provided to the command are read from ... read from the environment variables of the remote computer. ...
    (comp.security.ssh)
  • How to read a remote environment variable when executing commands using SSH
    ... I want to execute a command to a remote computer using ... Some of arguements provided to the command are read from ... read from the environment variables of the remote computer. ...
    (comp.unix.shell)
  • Re: Execute failed in Ant
    ... > runs an executable used in preprocessing of some products. ... When I execute it as part of ant, ... > to set environment variables, ...
    (comp.lang.java.programmer)
  • Re: "ant -version" -> build.xml does not exist
    ... ant-zip and set the environment variables. ... Under bash you can do 'which ant' to find out exactly which command you are invoking, but I'm not sure that Windows has an equivalent. ... If I had to guess at what the problem was I would say that you have another script on your path called 'ant' or 'ant.bat' that is calling the standard ant script without passing the command line arguments. ...
    (comp.lang.java.programmer)
  • Runtime.exec() with env and working directory parameters is not working.
    ... I have a problem with Runtime.exec command when I want to execute it ... uses certain environment variables ... If I use cmd /c,go to the working directory using cd then it works ...
    (comp.lang.java.gui)