Runtime hello=Runtime.getRuntime(); //Runtime構造函數私有,只能通過(guò)這種方式獲得實(shí)例。
hello.exec("cmd /c start Java -D org.apache.axis.wsdl.WSDL2Java http://www.scottnichol.com/samples/hellowsdl2.php?wsdl");
調用javac:
com.sun.tools.javac.Main javac = new com.sun.tools.javac.Main(); //這個(gè)包在tools.jar中。
String[] cpargs = new String[] {"-d", "所在目錄","Temp.java"};
int status = javac.compile(cpargs);
if(status!=0){
System.out.println("沒(méi)有成功編譯源文件!");
return null;
}
聯(lián)系客服