x*****r 发帖数: 2404 | 1 整个过程:
java程序1生成input file,
c程序读取input file,生成output file,
java程序2读取output file.
我现在的笨办法是用一个batch file把他们连起来。
能不能只用一个java程序就完成这件事情,
在里面直接调用那个c的可执行程序?
这样的话也方便我大量的循环做这件事情。
多谢多谢。 | H***a 发帖数: 189 | 2 Process process = Runtime.getRumtime().exec("Your C program command line");
process.waitFor();
//you need to read the stdout and stderr from the process to avoid stuck
//process.getInputStream() and process.getErrorStream()
return process.exitValue();
【在 x*****r 的大作中提到】 : 整个过程: : java程序1生成input file, : c程序读取input file,生成output file, : java程序2读取output file. : 我现在的笨办法是用一个batch file把他们连起来。 : 能不能只用一个java程序就完成这件事情, : 在里面直接调用那个c的可执行程序? : 这样的话也方便我大量的循环做这件事情。 : 多谢多谢。
|
|