level 8
丶我是程序猿
楼主
关于java Runtime.exec()
我想java调用本地的一个exe程序
cmd命令为:String cmd = "openRTSP -4 -D 10 -w 640 -h 320 -f 15 rtsp://192.168.1.100:554/h264.sdp >>C:\Program Files\Darwin Streaming Server\Movies\test.mp4"
当我使用Runtime.exec(cmd);
得到的返回结果Runtime.exec(cmd).wateFor(); 为1...
如果正常应该返回0,并且在C:\Program Files\Darwin Streaming Server\Movies\可以看到test.mp4文件
直接将cmd 在控制台中测试,可以正确执行
用程序调用就出了问题~
具体代码 如下
Runtime rn = Runtime.getRuntime();
Process p = null;
String cmd = "openRTSP -4 -D 10 -w 640 -h 320 -f 15 rtsp://192.168.1.100:554/h264.sdp >>C:\Program Files\Darwin Streaming Server\Movies\test.mp4";
p = rn.exec(cmd);
int result = p.waitFor();
syso(result);
p.destory();
有了解的大神能帮忙看下么,卡了好久了..
2013年09月03日 04点09分
1
我想java调用本地的一个exe程序
cmd命令为:String cmd = "openRTSP -4 -D 10 -w 640 -h 320 -f 15 rtsp://192.168.1.100:554/h264.sdp >>C:\Program Files\Darwin Streaming Server\Movies\test.mp4"
当我使用Runtime.exec(cmd);
得到的返回结果Runtime.exec(cmd).wateFor(); 为1...
如果正常应该返回0,并且在C:\Program Files\Darwin Streaming Server\Movies\可以看到test.mp4文件
直接将cmd 在控制台中测试,可以正确执行
用程序调用就出了问题~
具体代码 如下
Runtime rn = Runtime.getRuntime();
Process p = null;
String cmd = "openRTSP -4 -D 10 -w 640 -h 320 -f 15 rtsp://192.168.1.100:554/h264.sdp >>C:\Program Files\Darwin Streaming Server\Movies\test.mp4";
p = rn.exec(cmd);
int result = p.waitFor();
syso(result);
p.destory();
有了解的大神能帮忙看下么,卡了好久了..