|
Kev's Development Toolbox |
|
| Development Utils: | Back |
| Classpath Searcher |
| Overview | ||||||||
|
Searches the current classpath for specific files, classes, or using wildcards |
||||||||
|
||||||||
| Description | ||||||||
|
I developed this app because I occaisionally needed to find which jar file in my classpath particular classes were being loaded from. This app will search through all directories, jars and zips in the current classpath for any class or file name. You can also add additional directories, zips or jars to the list to be searched
- this is useful if you need to search through a collection of jars for a particular
file or class.
|
||||||||
| Running the app | ||||||||
|
1. To run the app from the jar: java -jar ClasspathSearchApp.jar This is probably only useful if you are going to manually add search directories/zips/jars to the search list once you have started the app, as the only thing in the classpath by starting the app from the jar will be the jar itself. 2. By adding the jar to the classpath - for example on Windows: java -classpath %CLASSPATH%;ClasspathSearchApp.jar kh.classpathsearch.ClasspathSearchApp |
||||||||
| Using the App | ||||||||
|
On startup, the app will show all the directories, zips and jars in the classpath in the left-hand side panel. You can either search through these, or add additional directories, zips and jars to the list. Viewing content of Jars or ZipsIf there are Jars or Zips in you current classpath (as displayed in the list on the left), you can display their content by clicking on the file name. The content of the file will be listed on the right panel. Adding files to the search listTo add to the list select "File" and the "Add File..." on the menu.Searching for Classes or FilesTo search, selct "Search", and then "Search for a class" on the menu, or press "Ctrl-S". Enter a class name, or a partial search value then press search. If the search take a more than a second or so, you'll see a progress bar while search is being performed. The results (if any) show the directory, zip or jar as the left-most value, followed by the file name
that was found matching the search criteria.
|
||||||||
| Interesting Features | ||||||||
|
||||||||
| Screenshot: | ||||||||
|
The screenshot below shows an example classpath (for Weblogic), and a search for files or classes matching 'Servlet':
|