在我的java程序中,我想调用eclipse ant来构建jar文件,如何获取eclipse的ant API。我可以通过Runtime.getRuntime.exec(“call ant build”)构建jar文件,但是用户必须安装ant。我们知道eclipse有ant,所以我想调用eclipse'ant来构建我的jar文件
In my java program, I want to call eclipse ant to build jar file, how I can get eclipse's ant API.I can build jar file by Runtime.getRuntime.exec("call ant build"),however users must have install ant.We know eclipse has ant, so I want to call eclipse'ant to build my jar file
最满意答案
如果您只想使用普通的Ant Java API,则只需将类路径设置为Eclipse中包含的Ant安装。 Eclipse在安装目录的plugins/org.apache.ant_xxx/lib目录中有Ant jar。
问题是org.apache.ant_xxx目录名中的xxx类似于1.8.4.v201303080030但根据安装的确切Eclipse版本而有所不同。
If you just want to use the normal Ant Java API you just need to set up your classpath to the Ant installation included in Eclipse. Eclipse has the Ant jars in the plugins/org.apache.ant_xxx/lib directory in the installation directory.
A problem is the xxx in the org.apache.ant_xxx directory name which will be something like 1.8.4.v201303080030 but varies depending on the exact Eclipse release that is installed.
更多推荐
ant,eclipse,jar,build,电脑培训,计算机培训,IT培训"/> <meta name="descrip
发布评论