Created
June 27, 2012 16:07
-
-
Save halyph/3005083 to your computer and use it in GitHub Desktop.
Read META-INF/MANIFEST.MF from jar file #java #manifest #read
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Manifest mf = new Manifest(); | |
mf.read(Thread.currentThread().getContextClassLoader().getResourceAsStream("META-INF/MANIFEST.MF")); | |
Attributes atts = mf.getMainAttributes(); | |
System.out.println("Version: " + atts.getValue("Implementation-Version")); | |
System.out.println("Build: " + atts.getValue("Implementation-Build")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is a great answer but what if there are thousands of jars?