本帖最后由 Jiewin 于 2013-6-11 00:34 编辑
- class RuntimeDemo
- {
- public static void main(String[] args) throws Exception
- {
- Runtime r = Runtime.getRuntime();
- r.exec("D:\\Program Files (x86)\\KuGou\\KGMusic\\KuGou.exe");
- }
- }
复制代码 报错是什么原因?
没解决此问题,害得我后面那几个实例都无法运行!
Exception in thread "main" java.io.IOException: Cannot run program "D:\Program":
CreateProcess error=2, ?????????
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1042)
at java.lang.Runtime.exec(Runtime.java:615)
at java.lang.Runtime.exec(Runtime.java:448)
at java.lang.Runtime.exec(Runtime.java:345)
at RuntimeDemo.main(MapDemo.java:608)
Caused by: java.io.IOException: CreateProcess error=2, ?????????
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:288)
at java.lang.ProcessImpl.start(ProcessImpl.java:133)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1023)
... 4 more
|