JAR Searcher Developer Tool
Often, Java Developers — Especially Those Working on Large Java EE Code — Realize that they are Facing Multiple Classpath Issues.
Join the DZone community and get the full member experience.
Join For Free
As a Java/J2EE developer, I know that the most commonly faced issue in development, which has also been reported as the primary reason for developers losing hair — missing classpath files or not being able to trace a JAR which contains the file — when you know you have all JARs that could possibly exist in this world on your local file system.
Just wrote this simple tool, JarSearcher v1.0, which accepts the name of the class file you are looking for and returns all the JARs on your system which contain this file. Also, for Windows developers, I have added a .bat file (Unix folks, kindly replicate .sh) which takes the following form for execution:
js [class-name] [start-in] -c
[class-name] — The name of the class file to search (without .class)
[start-in] — The directory in which to start looking for the files.
[start-in] — The directory in which to start looking for the files.
-c — This switch will toggle display of processing information.
Or you can directly invoke the program from the bundled JAR file:
java -jar jar-searcher.jar [class-name] [start-in] -c
I have included the source, feel free to modify it as per your convenience.
JAR (file format)
dev
Published at DZone with permission of Sumith Puri. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments