没有错误没有输出,无法理解哪里出错。
String[] commands = new String[] {"maude", "in 1.maude", "red f(a, b, e) ."};
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(commands);
InputStream stdin = proc.getInputStream();
InputStreamReader isr = new InputStreamReader(stdin);
BufferedReader br = new BufferedReader(isr);
String line = br.readLine();
while ( (line = br.readLine()) != null) {
jTextArea4.append(line + "\n");
}
最初,我有一个字符串数组,第一个运行Maude控制台,第二个是Maude控制台的命令,它说明我们感兴趣的模块(文件)是什么(要加载哪个文件),以及最后一个是检查Maude模块中某些属性的实际命令!
答案 0 :(得分:2)
使用:
String maudeCommand = "full_path_to_maude\\maude.exe";
String[] commands = new String[] {"cmd.exe", "/c", maudeCommand, "in", "1.maude", "red", "f(a, b, e)", "."};
将full_path_to_maude
替换为 maude.exe 的位置。