How to create a non-executable / non-executable jar with other external jar dependencies in Eclipse

I can’t create a regular jar (not executable / not executable) through the eclipse export wizard, it only creates a jar file, but the dependent jars do not export the error that occurs when calling the methods of the exported jar from any other class. Please help

+4
source share
2 answers

Thank you very much @kurellajunior for your suggestion .. he decided using zipgroupfileset . below is an ant script that perfectly creates the jar as I needed

<project default="jar"> <target name="jar"> <jar destfile="destination directory/jarFileName.jar" basedir="my Eclipse project folder/bin (which holds all the .class files of my project separated by different package folder) "> <zipgroupfileset dir="Location of my external jar file directory" includes="*.jar"/> </jar> </target> </project> 
+3
source

This is implied in the language / IDE concept. You only create a jar (library). Dependencies are managed externally (for example, in maven). In executable banks, there may be a manifest indicating the dependencies, but nevertheless, the dependencies must be connected by you ...

In earlier times, Netbeans did a decent job of combining all the connected cans - they have not used it for a long time.

Jan

EDIT: It is possible to create such a jar - on the command line. Since jar is just a mail container, you can easily write a script that undoes all your dependencies together with your bank in one place, and then merges everything together again.

I do not recommend it!

0
source

All Articles