ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz SÅ‚owikowski <>
Subject Java task - why is redirecting out stream to file not compatible with spawn
Date Wed, 15 May 2013 14:02:45 GMT

I'm starting a process by configuring and executing Ant Java task from
my software, see:

Sometimes I need to redirect output stream to a file when starting
external process. This is configurable,
but by default I start it with spawn flag set. When spawning, I cannot
redirect process'es output stream to a file, Ant does not allow it. I
wonder why.

I found a workaround:
When spawning I set system property telling spawned process to redirect
its output to a file:

In the spawned process:

I don't like this solution, but it works if everything goes well.

I the spawned process does not start (for example I try to allocate too
much memory with Xmx argument) I cannot tell what went wrong. The reason
is written
to the output stream, but the output stream is not being output anywhere.


Grzegorz Slowikowski

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message