Execute failed in Ant

E

Eric Bresie

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
 
B

Berlin Brown

Eric said:
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

I dont about that, I have tried hundreds of different kinds of apps on
windows and linux, Try to add the OS tag.

<exec dir="${build.dir}" executable="appletviewer" os="Linux">
<arg line="x.html"/>
</exec>

And probably read the ANT tag docs there are probably some other
variables you can add.
 
M

Mike Schilling

My current build.xml command looks like the following:

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

You should read http://ant.apache.org/manual/CoreTasks/exec.html, which
describes the exec task in detail. It explains that "executable" is the
name of the command to run *without* arguments. You need:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top