Reputation: 15338
I have a project which has some lib's associated with it (in Build Path).
Now, when I export the project in jar, I have mulitple options e.g., eclipse creating a new manifest file (with just one line), create a runnable jar (where it will add the classpath information as well).
My question is, is there a simple way in eclipse where it will add the classpath libraries into the manifest (i dont want to create runnable jar). I know I can edit jar in various ways. If the answer is "no, there is no direct way", my next question is, "Why, this is a very common requirement, is not it" and eclipse does so while creating a runnable jar, then why not for non-runnable jars?
Upvotes: 1
Views: 4325
Reputation: 54074
"Why, this is a very common requirement, is not it" and eclipse does so while creating a runnable jar, then why not for non-runnable jars?
Who says it is a common requirement?
A jar
file is just a library. Could be self-contained or dependent on other jars.
If you have a dependency for a jar
you document it as dependency. You don't distribute jars that include other jars.
E.g. if you include an apache library in your project you also download commons-logging
separately as a dependency.
It is not included/bundled in the jar.
Otherwise you'll end up with jars the size of 30 MB ....
Upvotes: 2