|
JARs Search
There are many resources on the web how to search JARs for classes and resources.
Most of them are searching JARs on the web.
The JarSearch
utility is a simple Swing standalone application in a single Java file which searches
classes and resources in JAR and ZIP files in a specified directory and subdirectories on your local station.
This utility was written to investigate JARs mess in WebLogic-10.
Since then it served many times for many different tasks. It could be a handy toy for your toolbox as well.
Why to search JARs on your local machine?
There are many occasions when this small utility might be helpful:
- Refactoring ANT based project to Maven.
Find what JARs in the ANT project contains the class.
Some legacy projects may have very unique JARs not available in Maven repositories.
- Resolving JAR class conflicts.
Search Maven target directory for some class in question and find how many JARs have it.
In many cases Maven could put multiple JARs with different versions from child dependencies.
Sometimes innocent legacy JAR contains classes which are now in a standard Java.
- Resolving JAR resource conflicts.
Search Maven target directory for some resource in question and find how many JARs have it.
There are no other ways to find out why some resource is loaded instead of expected one.
- Mass search.
Provide class names in a list and search what JARs contain them.
The list with class names could be created from Java imports or from class loader console log.
The utility creates multiple collections to present search results:
- Progress...
- All JARs
- All classes
- JAR to class
- Class to JAR
- Not found classes
- Duplicate classes
Here is an example screen shot for the java.lang.String class
search on workstation with multiple JREs installed:
How to start JarSearch
Download the source
JarSearch.java class,
compile and run it. Optionally you may download ready to use
JarSearch.jar
and start the application with the command:
|
|
|