ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Mazzitelli <>
Subject exec and the input hanging problem
Date Tue, 03 Feb 2009 06:21:54 GMT
I am hitting the bug where Ant hangs when doing an <exec> - see bug:

I can't seem to get the workaround of using inputstring to work. I can 
replicate this bug, even when using inputstring="", on both Ant 1.6.5 
and Ant 1.7.1 - and I've seen this on both solaris and linux.

It's really simple to replicate - I'd appreciate it if someone can give 
me an idiot lesson on what I'm doing wrong, or tell me if I should 
submit another bug report on this.

1) Put the following three files in a directory (,  build.xml 
and - see below).
2) Compile via "javac".
3) Finally, just run "ant".

The ant script should complete very fast because puts the 
Java VM in background via "&". However, ant just hangs and will only die 
when the Java VM dies (which will be after a sleep of 60 seconds):
java Test 60000 &

<project name="test" default="do">
  <target name="do">
     <echo>Executing - this should go fast...</echo>
     <exec dir="." inputstring="" executable="/bin/sh">
       <arg line=""/>
     <echo>Execute finished.</echo>
public class Test {
  public static void main(String[] args) throws Exception {
     System.out.println("Java: sleeping");
     System.out.println("Java: done sleeping");

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

View raw message