Java外部程序 [英] Java external program
问题描述
我想从我的Java应用程序启动外部第三方应用程序。这个外部应用程序应该在我的java应用程序运行时一直运行。
I'd like to start external third party application from my Java application. This external application should run all the time whilst my java application runs.
不时(这取决于用户交互)我的java应用程序应该能够通过 stdin读取和写入这个外部应用程序
和 stdout
。
From time to time (it depends on user interaction) my java app should be able to read and write to this external application via stdin
and stdout
.
我该怎么做?
推荐答案
是ex-app本机代码还是其他Java程序?如果是本机代码,请查看 http:// download.oracle.com/javase/1.5.0/docs/api/java/lang/Process.html 和 http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Runtime.html
Is ex-app native code, or another Java program? If it's native code, look at http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Process.html and http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Runtime.html
这些将允许您执行本机程序,跟踪其状态,并获取其输出并发送输入。
Those will allow you to execute a native program, keep track of its status, and get its output and send it input.
这篇关于Java外部程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!