Saturday, September 27, 2008

As a Java developer I'm sometimes bitten by a bug when runtime loads a wrong class form a wrong library. Often times I'd loose a lot of time tracing the problem to multiple versions of the same library loaded. This quite often happens when you use Maven. For instance, if you put a dependency on two different libraries, and one of them pulls down one version of Log4J, while another loads a different version of it, you are going to end up with two versions of the same. Chances are that they not compatible with one another.

After stumbling into this situation a few times, I decided to write a simple Swing based app for tracing down all the jars in a specific directory. Thus, the JarExplorer was born.

JarExplorer is a simple tool which can be used to inspect large jar repositories. It will allow to locate classes, property files, images, and all other resources inside those libs.

It works very well for me, and I hope someone else will also find it useful.

It can be downloaded from the following location: http://code.google.com/p/jar-explorer/


Besides ability to open images, text and HTML, it also alloes to peek inside classes. It will show inheritance, all methods (even private) as well as all member variables. This is accomplished via use of a library called javad: http://www.bearcave.com/software/java/javad/index.html by Ian Kaplan.
Java reflection was too limiting for the purpose, but Ian's library worked quite well.

The JarExplorer is fully self-sufficient, and does not require anything else (besides Java :)).
When it starts up, point it to a directory with jar files and wait a bit until it indexes every jar in it (recursively of course). After that you can do very fast searches using this tool.


Good luck
igor

No comments: