Search This Blog

Searching class file in bunch of jars


While doing development , I had been through the situation when I need to know that a particular class belongs to which jar, and I have bunch of jars to scan. If you have 1 or two jars you can extract it using winzip or any other utility and search for your class file-not a big deal BUT   the problem comes when you have so many jars that extracting and searching your class file is not a viable solution . You can use below command to search for any class among multiple jars. This command works on windows OS.


forfiles /S /M *.jar /C "cmd /c jar -tvf @file |
findstr /C:"SearchClass.class" && echo @path" 

No comments:

Post a Comment