including multiple jars in a single executable jar

A

Allen Wallis

Hi,
I am trying to package my application as a single jar file, say
app.jar, that can be executed using java -jar app.jar. The problem is
that app.jar requires extensions, say ext1.jar and ext2.jar. I know I
can use the Class-Path manifest entry to ensure that these extensions
are added to the classpath, however this means that I must send the
end-user 3 files - app.jar, ext1.jar and ext2.jar.

Can I package ext1.jar and ext2.jar inside app.jar so that I only need
the app.jar file in order to run the application? I do not want to
unpack the extension jars since they may be 3rd party jars and I would
prefer them to remain intact.

The goal of this exercise is to have a single 1-click executable jar,
the end user should be able to receive the file, and double-click to
run it.

Thanks
Allen
 
N

Niels Dybdahl

Can I package ext1.jar and ext2.jar inside app.jar so that I only need
the app.jar file in order to run the application? I do not want to
unpack the extension jars since they may be 3rd party jars and I would
prefer them to remain intact.

I can not see the problem in unpacking ext1.jar and ext2.jar and then
packing the contents into your app.jar even if they are 3rd party. Its an
easy and simple operation.

Niels Dybdahl
 

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,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top