• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 768
  • Last Modified:

jar version

Hi ,
I have a java web app and I want to know the versions of the external jars used in it . How can I do that ?
0
randyraj
Asked:
randyraj
  • 2
1 Solution
 
CEHJCommented:
That's not necessarily easy. If you're lucky, the filename will imply a version number. If not, there's a slim chance that some of the jars might have a class that will report its version number. If not, you're out of luck without some very difficult detective work
0
 
Sharon SethCommented:
See if this helps :

public static void main(String[] args) throws IOException 
{
		JarFile myJar = new JarFile("C:\\j2ee.jar");
		Manifest myManifest = myJar.getManifest();
		Map manifestAttrs = myManifest.getMainAttributes();
		System.out.println(manifestAttrs);
		for(Object o : manifestAttrs.entrySet())
			System.out.println(o);

}

Open in new window

0
 
CEHJCommented:
That's a good idea!
0
 
randyrajAuthor Commented:
I have been opening the manifest of each jar and seeing it manually . most of them dont have proper version number.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now