-
May 24th, 2007, 09:07 AM
#1
getting jar file version number
Hi
how to access an application server and get the version number of the jar files in that server ?
I am beginner in java
Regards
-
May 24th, 2007, 09:50 AM
#2
Re: getting jar file version number
Hello mohamed.
To have access to the version of a jar file, you should have access to the jar file. Precisely, you need to take a look at the jar file's manifest (but not always a version is specififed).
_______________________
Is this post useful? If yes, I would appreciate if you rate it!
Leandro T. C. Melo
http://www.pazbrasil.org/
-
May 25th, 2007, 03:18 AM
#3
Re: getting jar file version number
Hi
Thanx for the reply
is there way to get this version programmatically ?
Regards
-
May 25th, 2007, 04:03 AM
#4
Re: getting jar file version number
Jar file is a zipped file. Basically you need to access it to get the files it contains, process the list of files untill you find manifest file, process that untill you come across version number.
The link below is about compressed files handling. Might be usefull.
http://www.javalobby.org/java/forums/t16299.html
-
May 25th, 2007, 07:34 AM
#5
Re: getting jar file version number
Hello again.
Originally Posted by mohamed123
is there way to get this version programmatically ?
Once you have access to the jar file, you could try this:
Code:
JarFile jarfile = new JarFile("jarfile.jar");
Manifest manifest = jarfile.getManifest();
//Iterate over the manifest's entries looking for what you need.
//Check out the Manifest class API.
You just need to check the java docs for the Manifest class.
_______________________
Is this post useful? If yes, I would appreciate if you rate it!
Leandro T. C. Melo
http://www.pazbrasil.org/
-
May 25th, 2007, 07:43 AM
#6
Re: getting jar file version number
you are most correct. Far better to use the class for Jar Files.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|