ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Clark <>
Subject Re: Capture returned value from Java?
Date Thu, 28 Sep 2006 19:35:14 GMT
On Thursday September 28, 2006 15:21, wrote:
> I'm confused about the "outputproperty" attribute of the <java>

> 1) What exactly does the "output of the command" mean? 

Whatever text is passed to System.out.print* (and System.err.print* 
usually, that's the "Unless the error stream is redirected ..." 
clause) in the Java application being run.

> I ask this because I haven't been able to figure a way of getting a
> value returned from a Java class into an Ant property.

If you mean the value passed to System.exit(), you can access this 
using the "resultproperty" property. You will have to set fork=true 
and failonerror=false to have this set though.

Note also that once you deviate from the convention that 0 == success 
and !0 == failure, Ant can no longer determine when you Java program 
actually failed (missing class/jar etc) so you will have figure out 
for yourself if the Java application failed.

See that note at 

- Rob

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

View raw message