stevebot
stevebot

Reputation: 24015

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 my 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.

Upvotes: 0

Views: 2742

Answers (2)

jvdbogae
jvdbogae

Reputation: 1229

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

Upvotes: 0

taxman
taxman

Reputation: 501

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.

Upvotes: 1

Related Questions