开发者

java executing batch file

I am executing a bat file from java (batch file executes another java app) Now, how can i make sure that batch executed and triggered the another j开发者_JAVA百科ava app.

IS there any way to tell that another java app started successfully.


I'd suggest running the other application directly from Java and then check the return code. Also, you could run the other application in its own controller thread from your first application.

Running one application via another batch file seems like an awkward design...


Why using a batch file? For all practical purposes, this is counter productive while using a platform independent language! Java can do well better than what batch files can do, and also will protect your application by not exposing how you launch other processes while not being dependent of a batch file process successful state...

Anyway, take a look here at how to start external processes and monitoring outputs using ProcessBuilder.

Also, you can check out the API.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜