ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chris brown" <>
Subject Packaging multiple JARs (WAS: Using Main-Class and Class-Path in a manifest file)
Date Wed, 13 Mar 2002 08:29:10 GMT

Hi all,

I asked this question in the past, and came to the conclusion that there's
no simple way to do this.  I've posted this as a RFE on Sun's Java site, so
if you're interested... vote for it! :-)

My current solution is to deploy applications in a zip file like this:

 |   |
 |   +--abc.jar
 |   |
 |   +--def.jar
 |   |
 |   +--ghi.jar

...where "appli.jar" contains a manifest with a "Main-Class:" attribute
pointing to some class in "appli.jar", and the other jars are referred to
from the "Class-Path:" attribute in "appli.jar"'s manifest too (values such
as "lib/abc.jar").  Just to make it perfectly clear, I didn't embed the
other jars inside each other: they're available close to each other on-disk
(after unzipping).

The "bat" and "sh" files contain lines such as:
java -jar appli.jar <params>

...because sometimes such a line is impractical or difficult for users to

The other workaround is to use a custom classloader, but you really to have
a good reason to go to such trouble... (IMHO).

-Chris B.

----- Original Message -----
From: "Diane Holt" <>
To: "Ant Users List" <>; <>
Sent: Wednesday, March 13, 2002 1:43 AM
Subject: Re: Using Main-Class and Class-Path in a manifest file

> --- Todd Wilson <> wrote:
> > It's not an absolute necessity for us to include everything in a single
> > jar file, but it is a convenience.
> Would there be a problem with sticking the individual log4j files into
> your jar (as opposed to putting them in as a jar themselves)?  If you did
> that then it should work (right?), and you'd still have a single jar file.
> Diane
> =====
> (
> __________________________________________________
> Do You Yahoo!?
> Try FREE Yahoo! Mail - the world's greatest free email!
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message