ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashant Reddy <>
Subject Re: how to get a process id from a spawned task?
Date Mon, 28 May 2007 12:28:44 GMT
If you are OK with using JDK 1.5, you could use 'jps' command that is
shipped with every JDK.

See :

Output of jps on my computer :
$ ~/programs/java/jdk1.5.0_10/bin/jps
20608 Jps
6550 Main

You could perhaps use ANT's <exec> task to run this command.

On Mon, 2007-05-28 at 08:19 -0400, Jay Dickon Glanville wrote:
> Hello all.
> Is there a way to get the process id (I'm dealing with a windows
> system here, but I believe the question could be asked of both windows
> an UNIX families) of a task that is spawned?  I have a java task:
>   <java spawn="true" ... />
> and I'd like to be able to echo the process id to the user (so that
> they can kill the process if they so desire).
> Is there a convenient way to get the process id?
> Thanks


Don't upload, just share :

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

View raw message