我正在制作一个程序,它必须用clafer -m=xml Case5.cfr
.
所以我用
ProcessBuilder pb = new ProcessBuilder("clafer -m=xml " + "Case5.cfr");
pb.directory(new File("C:\\Users\\unituser\\workspace\\com.unitbilisim.clafer2Ecore\\src\\model\\"));
Process P = pb.start();
但总是出现以下错误:
Exception in thread "main" java.io.IOException: Cannot run program "clafer -m=xml Case5.cfr" (in directory "C:\Users\unituser\workspace\com.unitbilisim.clafer2Ecore\src\model"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at EmfCompare.emfCompareDeneme.main(emfCompareDeneme.java:54)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 2 more
我不明白为什么。谁能帮我?