Sometimes I get a third party JAR that does not contain a version number in the file name, and I need to know what version of that library the JAR file contains. For instance, say the file is foobar.jar and it was version 1.2.0. How do I determine that the foobar.jar file I have is version 1.2.0?
Someone told me that you can use the following command "java -jar jarname.jar -v" to retrieve the version number from a JAR file, but I've never gotten any output when using that command. I see that many JARs have MANIFEST.MF entries with version info. Is there a manifest entry key that the java -jar command listed above is looking for in a manifest? If not, what does the java -jar command listed above supposed to retrieve and from where? I tried inserting a manifest entry of "Version" with a value, but the command listed doesn't retrieve that.