Is there a command line tool to tell me which JAR class belongs to the class

Is there a command line tool that will crack the JAR file and find the specific .class file in it? Something that would allow me to go through the directory tree in search of someone who has a specific Jar class, such as ...

find . -name *jar -exec jaregrep -l "org.bob.PriceListViewUpdate" {} \; REST/prices.jar v2/REST/prices.jar 

Something like this should exist. Where can i get it?

+4
source share
4 answers

If you know which directory the jar is in, you can use grep on linux. Run this command from the directory above the suspicious jar files. It will tell you which jar file (or files) has it. I do this all the time when I'm looking for something in a jumble of JBoss jars.

 grep -rail --include=*.jar org.bob.PriceListViewUpdate 
+6
source

JWhich provides command line tools for finding the jar file that contains the resource you are looking for.

+1
source

I use this one:

 #!/bin/sh find $1 -name *jar | while read JARFILE do COUNT=$(unzip -qq -l "$JARFILE" "$2" | wc -l) if [ $COUNT -gt 0 ] ; then echo "$JARFILE: $COUNT matches" fi done 

t

 ./findclass.sh workspace-indigo/ org/objectweb/* 

You can use globs for package names, but you must specify the package names with a slash instead of fullstops as a backdraw.

+1
source

I want to add TattleTale to this list. This is a tool for creating a detailed HTML banner list report.

It is usually useful to debug version conflicts.

http://www.jboss.org/tattletale

0
source

Source: https://habr.com/ru/post/1394313/


All Articles