views:

19

answers:

1

HI,

I have a large number of jars that my j2ee app depends on, so I want to create a single jar file with manifest attribute referencing those jar files in classpath. Then I will place this file in glassfish lib dir so that jars mentioned become in classpath for application.

the only problem is I dont know how to create this single jar file.

suggestions ?

regards

A: 

The jar program (used to create jars) has a -m entry used to specify a manifest file.

In this manifest file, you could specify the location of other jar files with the Class-Path attribute.

See here: http://download.oracle.com/javase/1.3/docs/guide/jar/jar.html

I personally haven't tried this, so I don't know how successful this would be.

You might want to just create a large jar file that contains all of your other jar files if you are concerned about this. I don't know if I would recommend this solution either.

Starkey