可以Ant启动两个Java应用程序并行? [英] Can Ant launch two java applications concurrently?

查看:361
本文介绍了可以Ant启动两个Java应用程序并行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发使用JDI连接到一个已经运行的目标的Java应用程序中的调试Java应用程序。有什么办法让Ant启动我的目标应用程序,然后启动我的调试之后,而第一个应用程序仍在运行?

I am currently developing a "debugger" java application that uses JDI to connect to an already running "target" java application. Is there any way to have Ant launch my target application then launch my "debugger" afterwards, while the first application is still running?

是的,我知道我可以开发应用JDI启动目标程序,但是这不是我想要的现在。

Yes I know that I can develop the JDI app to launch the target program, but that is not what I want right now.

推荐答案

您可以一个Ant的并行 的任务。

You can spawn two java programs from within an Ant parallel task.

<parallel>
  <sequential>
    <java fork="true" classname="prog1 .... >
  </sequential>
  <sequential>
    <sleep seconds="30"/>
    <java fork="true" classname="prog2.... >
  </sequential>
</parallel>

在第二个线程中的睡眠的任务可以由 WAITFOR 的条件下进行更换。

The sleep task in the second thread could be replace by a waitfor condition.

这篇关于可以Ant启动两个Java应用程序并行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆