List contents of multiple jar files

前端 未结 9 843
情歌与酒
情歌与酒 2021-02-02 10:50

I am searching for a .class file inside a bunch of jars.

jar tf abc.jar 

works for one file. I tried

find -name \"*.jar\" | xa         


        
9条回答
  •  爱一瞬间的悲伤
    2021-02-02 11:36

    Find jar files and get all classes and members saved on a txt.

    (for j in $(find -name '*.jar');do echo "--$j --";jar tf $j | grep .class | sed 's#/#.#g' | sed 's/.class/ /g' | xargs -n 1 javap -classpath  $j ; done;) >> classes.txt
    

提交回复
热议问题