java调用eclipse的ant API(java call eclipse's ant API)

编程入门 行业动态 更新时间:2024-10-24 08:24:18
java调用eclipse的ant API(java call eclipse's ant API) java

在我的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

本文发布于:2023-08-07 12:39:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464263.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:eclipse   java   ant   call   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!