Jar files in Jar files

E

Eric McIntyre

I'm trying to create a Jar file that contains not only my classes but
also the 3rd-party dependency Jars. The problem is that I can't quite
figure out suitable Class-Path entries to pick them up.

Given the Jar structure of my.jar:
com/package/path/to/My.class
lib/lib1.jar
lib/lib2.jar
META-INF/MANIFEST.MF

The closest I've been able to get is
Class-Path: jar:file:my.jar!/lib/lib1.jar
jar:file:my.jar!/lib/lib2.jar

Is it possible to remove the hardcoded Jar filename? Or is this the
best there is?

Thanks,
Eric
 
R

Roedy Green

The closest I've been able to get is
Class-Path: jar:file:my.jar!/lib/lib1.jar
jar:file:my.jar!/lib/lib2.jar

You can't do that. Jars don't nest. You have to unpack the dependent
jars and add the files individually.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top