问题描述
我需要从我的 Eclipse Java 项目中导出 jar 并且我想包含引用的库.我不能为此使用 fatjar,这似乎是每个人都推荐的.必须有另一种方法来做到这一点.有谁知道这是什么?!
I need to export jar from my Eclipse Java project and I want to include the referenced libraries. I can't use fatjar for this, which is what everyone seems to recommend. There must be another way of doing this. Does anyone know what this is?!
推荐答案
Eclipse 的下一个版本(3.5,明年 6 月到期)可以选择包含所有必需的 jar.它是在 3.5M5 中引入的(感谢,basszero).
The next version of Eclipse (3.5, due next June) has an option to include all necessary jars. It was introduced in 3.5M5 (thanks, basszero).
或者您可以尝试使用 Maven 2 构建您的项目.然后,您可以使用 mvn assembly 构建一个胖"jar:汇编
.
Or you can try to build your project with Maven 2. Then, you can build a "fat" jar with mvn assembly:assembly
.
另一种选择是使用 ant.将所有 JAR 文件解压到临时目录中,然后再次将它们打包.
Another option is to use ant. Unpack all JAR files into a temp directory and jar them up again.
这篇关于Eclipse Java;导出 jar,包括引用的库,没有 fatjar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!