If I start a forked java process from an ant script and kill the ant process, it does not kill the java process. This is the case whether running it from the IDE or from the command line.
<target name="myTarget" >
<java classname="path.to.MyClass"
fork="yes"
failonerror="true"
maxmemory="128M">
<classpath refid="run" />
</java>
</target>
Is there a way to link these, so that killing the ant process will kill the java process?
I've seen the following Q&A - but this seems to focus on how to kill the java process manually. I don't want to do this, because I have a number of other java applications running, and finding the right java.exe process to kill in TaskManager is not always straight forward.