Suppose there is a jar file named callme.jar
and it's located in several directories,
how to analyse which one of them is used at run-time?
If the JAR file contains compiled . class files, I would suggest JD-Gui. Type that on Google. That what I use everyday to have an overlook at methods signature and public functions etc..!
Download a hex editor and open one of the class files inside the JAR and look at byte offsets 4 through 7. The version information is built in. Note: As mentioned in the comment below, those bytes tell you what version the class has been compiled FOR, not what version compiled it.
It is often located in the "Program Files\Java" or "Program Files (x86)\Java" folder, within a possible subfolder below the Java folder. Once you find the file, select it and click OK.
Jar files are archive files that contains of a lot of different java classes (files). You can use winzip/winrar to open the jar files and you can see those java classes in jar files. Typically you can use a Java decompiler to decompile the class file and look into the source code.
Invoke the java
executable with the -verbose:class
argument. This will produce output like:
[Loaded org.apache.log4j.helpers.ThreadLocalMap from file:/C:/.../1.2.14/log4j-1.2.14.jar]
[Loaded org.apache.commons.cli.Option from file:/C:/.../commons-cli-1.2.jar]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With