JARs containing JARs

Discussion in 'Java' started by alan@engrm.com, May 18, 2005.

  1. Guest

    , May 18, 2005
    #1
    1. Advertising

  2. millerch Guest

    millerch, May 18, 2005
    #2
    1. Advertising

  3. Steven Green Guest

    On Wed, 18 May 2005 22:04:51 +0100, millerch wrote:

    > Why not unzip the dependant jars and create a new jar containing your
    > application, and all its dependant class files?
    >
    > wrote:
    >> Is it possible to create a jar that contains its dependant jars so
    >> that you can distrbute an application as a single jar?
    >>
    >> --
    >> Alan Gutierrez -
    >> - http://engrm.com/blogometer/index.html
    >> - http://engrm.com/blogometer/rss.2.0.xml


    Unziping is simple enough admittedly, but I personally would
    not want to mess with someone elses library. If there is a way to
    nest jar files I would love to hear about it.

    --Steve
     
    Steven Green, May 18, 2005
    #3
  4. Steven Green wrote:
    >
    > On Wed, 18 May 2005 22:04:51 +0100, millerch wrote:
    >
    > > Why not unzip the dependant jars and create a new jar containing your
    > > application, and all its dependant class files?
    > >
    > > wrote:
    > >> Is it possible to create a jar that contains its dependant jars so
    > >> that you can distrbute an application as a single jar?

    >
    > Unziping is simple enough admittedly, but I personally would
    > not want to mess with someone elses library. If there is a way to
    > nest jar files I would love to hear about it.


    You can't load classes from nested jars. You could write your own classloader to do
    that, but it won't be very efficient because you'll have to scan the nested jars for
    each class loaded.

    Otherwise, unzip the nested jars in with your regular jar (as millerch suggested) or
    extract the nested jars into the file system.

    --
    Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
    ==============================================================
    * The Ultimate DBMS is here!
    * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
     
    Lee Fesperman, May 19, 2005
    #4
  5. wrote:
    > Is it possible to create a jar that contains its dependant jars so
    > that you can distrbute an application as a single jar?


    No, this has been discussed often in the past. Search an archive of this
    group for details.

    /Thomas


    --
    The comp.lang.java.gui FAQ:
    ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
     
    Thomas Weidenfeller, May 19, 2005
    #5
  6. Guest

    On 2005-05-19, Thomas Weidenfeller <> wrote:
    > wrote:
    >> Is it possible to create a jar that contains its dependant jars so
    >> that you can distrbute an application as a single jar?

    >
    > No, this has been discussed often in the past. Search an archive of this
    > group for details.


    I figured as much.

    I'd looked through the JAR documentation, didn't see this ability, but
    didn't see any place that said it couldn't be done. When I ran across
    custom class loaders to read nested jars, I figured it was probably not an
    easy thing to do. The JNLP/Java Web Start seems to address the problem for
    Swing UIs, and WARs wor Web Applications, but nothing for a library
    distrubtion. Which is fine.

    Thank you all.

    --
    Alan Gutierrez -
    - http://engrm.com/blogometer/index.html
    - http://engrm.com/blogometer/rss.2.0.xml
     
    , May 19, 2005
    #6
    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. Wendy S

    Re: classpath & too many jars

    Wendy S, Jul 22, 2003, in forum: Java
    Replies:
    1
    Views:
    469
    Wendy S
    Jul 22, 2003
  2. Ike
    Replies:
    6
    Views:
    1,057
    Andrew Thompson
    Sep 24, 2004
  3. JavaEnquirer
    Replies:
    2
    Views:
    519
    JavaEnquirer
    Feb 22, 2006
  4. Replies:
    7
    Views:
    1,624
    Andrew Thompson
    Jan 14, 2009
  5. Ulf Meinhardt
    Replies:
    2
    Views:
    1,404
Loading...

Share This Page