jar version

Posted on 2012-09-06
Last Modified: 2012-09-08
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 ?
Question by:randyraj
    LVL 86

    Expert Comment

    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
    LVL 12

    Accepted Solution

    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();
    		for(Object o : manifestAttrs.entrySet())

    Open in new window

    LVL 86

    Expert Comment

    That's a good idea!

    Author Comment

    I have been opening the manifest of each jar and seeing it manually . most of them dont have proper version number.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    One of the major drawbacks of deploying applications by GPO is the complete lack of any centralized reporting. After a normal deployment, there are two ways to find out if it was successful – by looking in the event log, and by looking in the log of…
    This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now