2010年7月21日 星期三

java 在windows 執行程式

用java 在windows 執行指令(如:dir這些指令)的時候,發生

以下這錯誤該怎麼辦?

java.io.ioexception cannot run program createprocess error 193

剛剛google 了一下

只要把程式碼內的

p = runtime.exec("你的指令");

改成

p = Runtime.getRuntime().exec("cmd.exe /C 你的指令");


以上解法來自這篇

2 則留言:

Unknown 提到...

你有甚麼特別需求要用到這玩意啊?

榮譽會長大人~!!

poormusic2001 提到...

就要用java去執行python的東西啊 = =

Class has no initializers in swift

Class has no initializers in swift I have met this situation. Found a solution here It says if you have the code like bellow var se...