| | |
How to add a jar within another jar?
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
nesting jarfiles isn't supported.
There are some proposals to allow for it, but nothing has yet reached prototype stage.
So at current the only way would indeed be to unpack the jars into one folder and repack them as a single archive.
Better (usually) to just add them all separately to your classpath.
It's a very rare case where there is a need to repack jars, usually it's only applicable when deploying packages to an application server where they would interfere with older versions of those same packages that the application server needs internally, a situation rare enough that most people never encounter it (I myself only have seen it once so far in a decade of using Java professionally).
There are some proposals to allow for it, but nothing has yet reached prototype stage.
So at current the only way would indeed be to unpack the jars into one folder and repack them as a single archive.
Better (usually) to just add them all separately to your classpath.
It's a very rare case where there is a need to repack jars, usually it's only applicable when deploying packages to an application server where they would interfere with older versions of those same packages that the application server needs internally, a situation rare enough that most people never encounter it (I myself only have seen it once so far in a decade of using Java professionally).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- How to include txt into jar file? (Java)
- JDBC jar files (Python)
- finding a class inside a jar file (Java)
- compiles but dont run (Java)
- Unsure of where to put classpath for mail.jar (Java)
Other Threads in the Java Forum
- Previous Thread: selecting radio button values
- Next Thread: Refresh a table
| Thread Tools | Search this Thread |
-xlint android api applet application array arrays automation bi binary blackberry block bluetooth chat class classes client code compile compiler component converter database developmenthelp eclipse error exception fractal freeze game gameprogramming givemetehcodez graphics gui html ide image input int integer j2me j2seprojects java javac javaprojects jetbrains jni jpanel jtable julia learningresources lego linux list login loop loops mac map method methods mobile netbeans newbie nonstatic notdisplaying number online page print problem program programming project qt recursion scanner screen server set singleton size sms sort sql string swing system template textfields threads time title tree tutorial-sample update variablebinding windows working xor






