从Java应用程序启动应用程序C ++ [英] launch an application C++ from a java application
本文介绍了从Java应用程序启动应用程序C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi everyine!
我有2个应用程序,一个用C ++编码,另一个用java编码,我想用另一个编译用c ++编写的应用程序,我真的不知道该怎么做
关于那个的任何想法???
非常感谢你的任何帮助
hi everyine!
I have 2 applications one coded in C++ and the other coded in java, i want to launch the one coded in c++ from the other one, honnestly i dont know how to do it at all
any ideas about that???
thank YOU very much for any help
推荐答案
你想向Google询问运行时间 [ ^ ]。以下是我用来做这类事情的一些代码:
You want to ask Google about Runtime[^]. Here is some code I use to do that kind of thing:
protected Process DoSysCommand(String sCmd, boolean bWait)
{
Runtime r = Runtime.getRuntime();
Process retP = null;
try
{
retP = r.exec(sCmd);
if(bWait)
{
retP.waitFor();
}
}
catch(IOException e)
{
System.err.println(e.getMessage());
}
catch(InterruptedException e)
{
System.err.println(e.getMessage());
}
return retP;
}
这篇关于从Java应用程序启动应用程序C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文