本文参考链接:https://www.cnblogs.com/happyPawpaw/p/3740903.html
import org.junit.Test;
import java.io.InputStream;
public class ObjTo {
@Test
public void objToGltf(){
//cmd.exe /c 命令
//注意千万不要用/k,因为/k窗口不会关闭导致程序在process.waitFor处会卡住(不报错,不结束)
String mingling = "";
String cmd = "cmd.exe /c "+mingling;
Runtime run = Runtime.getRuntime();
try {
Process process = run.exec(cmd);
InputStream in = process.getInputStream();
while (in.read() != -1) {
System.out.println(in.read());
}
in.close();
process.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
}