调用C的问题
public class runTest{public static void main(String argv[]){
try{
Runtime runTime=Runtime.getRuntime();
runTime.exec("zuoye.exe");
}catch(Exception e){
e.printStackTrace();
}
}
}
出错:
java.io.IOException: CreateProcess: zuoye.exe error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:566)
at java.lang.Runtime.exec(Runtime.java:428)
at java.lang.Runtime.exec(Runtime.java:364)
at java.lang.Runtime.exec(Runtime.java:326)
at runTest.main(runTest.java:5)
Press any key to continue...
我的思路:
我是想设计一个界面(JAVA编),然后设计一个按钮,当按下按钮时,就会弹出我用C编写的程序的结果。
应该是从“在JAVA中调用C”入手吧?
请教各位师兄师姐了!!!