来源(Chinese Linux University)
From: http://www.chineselinuxuniversity.net/articles/31689.shtml
摘自: www.chinaitlab.com 被阅读次数: 7由 yangyi 于 2010-01-28 21:02:46 提供
调用java:
Runtime hello=Runtime.getRuntime(); //Runtime构造函数私有,只能通过这种方式获得实例。 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(); //这个包在tools.jar中。 String[] cpargs = new String[] {"-d", "所在目录","Temp.java"}; int status = javac.compile(cpargs); if(status!=0){ System.out.println("没有成功编译源文件!"); return null; } |
原文链接: http://java.chinaitlab.com/advance/801754.html.