Blog / 20080331 aQute - Software Consultancy
Search
*

Bnd gets an Editor (well Viewer for Jars)

Last year I bought a Mac and I thoroughly enjoy it. About 8 years ago I was forced to leave Apple because their support for Java was awful, all the new stuff happened on the PC. However, when my PC broke down I decided to get a Mac again. Good choice!

However, I missed Winzip. I very often have to inspect Jar files and when I need to look inside, I have Eclipse in front of me. If I double click on a Jar file, Eclipse tries to start it. For bundles, this rarely works because they lack the Main-Class entry. On the PC, I associated Winzip with the .jar extension and that gave me a reasonable overview of what was inside. Alas, the Mac does not have Winzip and Stuffit does not have a content window.

A lesser known feature of Bnd is its support for inspecting a Jar file. The print function is quite powerful. It allows you to see the manifest, it calculates the imports, verifies the headers, and most useful of all, it creates a cross reference listing of all the packages. That is you can see exactly what packages are used by whom. Obviously, I could just go to the command line and run bnd from there, but it is always awkward to get in the right directory.

So I just added a tiny little feature to bnd that creates a text editor with the contents of the print output. Though it looks a bit odd, the information it provides is very helpful, at least for me.

You can easily download bnd in your plugins directory from the download page. Restart Eclipse and double click a Jar file! Good luck.

   Peter Kriens

P.S. Neil Bartlett just pointed me to JarPlug which provides a viewer for Jars. Very nicely done and it looks a lot better than the text output of bnd. Then again, that output does contain a lot more analysis and is easy to search ... Would be nice if the two were combined. If only I had time ...

Copyright 2006 aQute SARL, All Rights Reserved