Ant 可以同时启动两个 java 应用程序吗? [英] Can Ant launch two java applications concurrently?

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

问题描述

我目前正在开发一个调试器"java 应用程序,它使用 JDI 连接到一个已经运行的目标"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 中生成两个 Java 程序 并行 任务.

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>

第二个线程中的 sleep 任务可以替换为 waitfor 条件.

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

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

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