Question on JAR files and the Manifest file

H

Harpstein

I've got a JAR file with a Manifest file with some entries that I've added.
What I don't understand is how to get those entries out of the Manifest file
itself.

I know about the JarFile and Manifest classes, but how I can use those from
within the JAR file?

Basically, what I have is a JAR file that gets loaded by a 3rd party app
(JBuilder) and I want a way to put information in that JAR about the product
bundled inside. Things like the version (not the JAR version, but the
version of my product that is included inside the JAR.) and the API version
(I have some JNI calls that I make to a DLL that I ship).

1. Is the manifest file the best place to put these? If not, where else can
they go? I'm new to Java so I'm not real hip to all of the "best practices"

2. If i'm inside a class that is bundled in the jar, can I get the jar's
path and name so that I can create a JarFile object, then get the Manifest
object from that? I can't seem to find any way to get the jar filename or
path, so I'm stuck...


Any help would be greatly appreciated..

-harpstein
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top