Searching .[jrw]ar files with JarSearch
Posted by danielmeyer on July 17, 2008
I decided to look around again to see if someone had already made a .[jrw]ar file searcher so we don’t have to do all that manual searching to find duplicately-deployed classes. A search of sourceforge.net turned up the JarSearch Eclipse plugin, made available under the GPLv2 license.
I extracted the .jar file from the download’s .zip file and copied it into my eclipse\plugins directory, then restarted Eclipse (JarSearch doesn’t seem to be set up to use the fancier method for installing an Eclipse plug-in using the Eclipse Update Manager). The most recent build of JarSearch is version 1.0 for Eclipse 3.2, but it seems to work ok on my Eclipse 3.3.2 installation.
Now when I hit Ctrl+H, I have a new Jar Search tab in the Search dialog, which allows me to search for a class inside archive files:
Notice that I added the rar extension to the list of filetypes to search inside of.
I click Search and JarSearch finds some classes with HAXA in their names inside .jar files that are nested inside two different .rar files. Wow, that’s nice!
Future Feature Wish: Saved Defaults
This plug-in is going to be so helpful to us. There’s just one thing I’d like to see improved — it would be nice if the options you pick could be saved as defaults for next time. As it is, after doing the search mentioned above, if I press Ctrl+H again and navigate to the Jar Search tab, the options are back to the original settings:
This means that I will always be needing to select the folder (which I think will usually be JBoss’s default\deploy folder) and add in the .rar extension. [Update 11/5/2008: Actually it turns out the folder I always want to search is the server\default folder, not server\default\deploy...]
That’s a minor gripe though. This utility is really going to be a help to us. Thanks, Alain!