Jar files in Jar files

Discussion in 'Java' started by Eric McIntyre, May 24, 2004.

  1. 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
    Eric McIntyre, May 24, 2004
    #1
    1. Advertising

  2. Eric McIntyre

    Roedy Green Guest

    On 24 May 2004 09:52:55 -0700, (Eric McIntyre)
    wrote or quoted :

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

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, May 24, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. harry
    Replies:
    1
    Views:
    480
    Sudsy
    Nov 22, 2004
  2. Arnold Peters
    Replies:
    0
    Views:
    555
    Arnold Peters
    Jan 5, 2005
  3. muttley
    Replies:
    0
    Views:
    2,696
    muttley
    Oct 20, 2005
  4. cyberco
    Replies:
    4
    Views:
    3,730
    Roedy Green
    Feb 14, 2006
  5. Arnold Peters
    Replies:
    0
    Views:
    640
    Arnold Peters
    Jan 5, 2005
Loading...

Share This Page