ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Murdoch <>
Subject Re: forking new jvm in ExecuteJava?
Date Wed, 10 Apr 2002 03:14:06 GMT
On Wed, 10 Apr 2002 12:57, tek1 wrote:
> hello.
> i've written a custom task that make a call to a third-party java .class.
> unfortunately, that .class is calling System.exit(0) and stopping the
> entire vm, which ant is running on.  how do i fork a new java vm within my
> custom task for the third-party java .class to execute in?

You'll need to use CommandlineJava and Execute, rather than ExecuteJava:

-  Create and configure an instance of CommandlineJava.  You configure it 
pretty much the same way as ExecuteJava - setClassname(), createClasspath(), 
createArgument(), etc.

- Call getCommandline() to build the command-line.

- Call static method Execute.runCommand() to execute the command.  
Alternatively, you can instantiate an Execute object, configure it manually, 
then call it's execute() method.


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

View raw message