Tuesday, October 21, 2014

JAR Searcher Developer Tool

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 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
-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.

No comments: