Home > Mobile >  How to read a file from nested jar at Linux?
How to read a file from nested jar at Linux?

Time:10-25

Is there any way to read some files from a jar inside the "outer" jar with javap command?

for example, I want to read the a.class

   A.jar
     |----/lib/
            |---B.jar
            |    |---/classes/
            |            |---a.class
            |            |---b.class
            |            |---c.class
            |---C.jar    

CodePudding user response:

JAR files are ZIP files with a different extension. You can first extract the inner JAR, then use javap on it:

unzip -p A.jar lib/B.jar > /tmp/B.jar
javap -classpath /tmp/B.jar classes.a
  • Related