JAR Versioning

Hi,

I am trying to use a manifest file to version my jar, it contains a number of different packages but I just want to version the whole jar. I have tried a using the implementation and specification tags, but I seem to be unable to retrieve the manifest data from the jar. I do not get any errors but neither do I get a version number.

Here is the contents of my manifest:

Manifest-Version: 1.0

Created-By: My Company

Name: com.xx.yyy.ppp.ttt.hy

Implementation-Title: "jar name"

Implementation-Version: "1.2.6"

Implementation-Vendor: "My company"

I have tried with and without quote marks, I have tried using the Package Class to list out all the packages and the implementation and specification versions and all i get is nulls for my packages and the JRE info.

Am I missing something here, I have looked around on the forums and the specs and I cant see what I am missing so any help would be great.

Thanks!

[985 byte] By [Psandher] at [2007-9-27 22:51:09]
# 1

Hi, I tried it out and it works.

My manifest.mf looks like this:

Manifest-Version: 1.0

Implementation-Version: 3.1415

the code I use to retrieve the info is

public static void main(String[] args) {

Class clazz=myClass.class;

String version=clazz.getPackage().getImplementationVersion();

System.out.println("version="+version);

}

I got the 3.1415 in the output!

perseios at 2007-7-7 14:00:23 > top of Java-index,Desktop,Deploying...