开发者

Creating a JAR file, some classes are missing

I'm creating a JAR file in Eclipse and for some reason classes are missing. The classes that are not included are referenced in other JAR files included on m开发者_运维知识库y build path. What doesn't make sense is that the behavior is not consistent. Some classes on the build path get included while others do not. Any ideas?

The step I take to create my JAR file, is to export all the source folders.


JAR files are libraries, and that means - thinking object oriented:

If the classes are referenced in other JAR that included in your build, so they have to be part of the included JAR files and not part on your new JAR.

That's the whole idea of a library - If I understand your question right.

If your JAR uses those external classes, so you have to include those classes's JAR files in your project.

I hope I understood you correctly.


When I need to distribute something for internal use, I use the Maven assembly plugin: it allows you to create jars with dependencies. This is very useful if you only want to pass around one single jar: http://maven.apache.org/plugins/maven-assembly-plugin/usage.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜