I am currently working on a J2ME polish application, just enhancing it. I am finding difficulties to get the exact version of the jar file. Is there any way to find the version of the jar file for the imports done in the class? I mean if you have some thing, import x.y.z; can we know the version of the jar x.y package belongs to?
相关问题
- Dependencies while implementing Mocking in Junit4
- Android version code for App updating
- Modelica libraries use different MSL version
- Unable to generate jar file for Hadoop
- Using task scheduler for running java jar (from ba
相关文章
- How to get java main class from jar file
- java.lang.NoClassDefFoundError: javax/servlet/http
- Default arguments in JAR-manifest
- intellij build jar artifact containing gradle depe
- Use local jar as a dependency in my Gradle Java pr
- ant jar's mainclass
- PowerShell ISE: how to run new PowerShell version
- IntelliJ compile for Java 7 JRE using Java 8 SDK
I'm late this but you can try the following two methods
using these needed classes
These methods let me access the jar attributes. I like being backwards compatible and use the latest. So I used this
This works well when you are using maven and need pom details for know classes. Hope this helps.
You can filter version from the MANIFEST file using
unzip -p my.jar META-INF/MANIFEST.MF | grep 'Bundle-Version'
Just to complete the above answer.
Manifest file is located inside jar at
META-INF\MANIFEST.MF
path.You can examine jar's contents in any archiver that supports zip.
Decompress the JAR file and look for the manifest file (
META-INF\MANIFEST.MF
). The manifest file of JAR file might contain a version number (but not always a version is specified).