autodisass-java-bytecode icon indicating copy to clipboard operation
autodisass-java-bytecode copied to clipboard

Opening a class in nested JARs doesn't decompile the file

Open Noricc opened this issue 3 years ago • 2 comments

I'm looking at the JAR of the Dacapo benchmarks. I want to check the bytecode of one of the classes of one of the benchmarks, called fop.

When I open a .class file in a JAR file, it works. However, My JAR file contains a directory in which other JAR files are stored (in a jar/ directory). Opening the nested jar files works (I can see the classes and look at them in fundamental mode), but with the plugin, I get the message : Error: class not found: org.apache.fop.fonts.substitute.FontSubstitutions.

Can I look at the generated javap command, to see what the problem is?

Noricc avatar Mar 30 '21 18:03 Noricc

I found out why it wasn't working, the command that is ran when reading a class inside a jar is javap -classpath <jar-file> <class-name>, which makes sense. In my case, this doesn't work because <jar-file> is not accessible (it's itself inside a jar).

I guess a workaround would be to extract the jar content into a directory. And then take a look.

Noricc avatar Apr 01 '21 11:04 Noricc

I haven't written Java for a while. Can you extract the contents of a class in the inner jar directly with javap, using the outer jar? Is this even possible with the proper manifest settings (e.g., classpath including inner jar)?

gbalats avatar Apr 02 '21 01:04 gbalats