Bytecode viewer tools: Jclasslib vs Classfile Inspector.
Posted on August 24th, 2006 in EN | 1 Comment »
Comparison overview of bytecode viewer applications Jclasslib Bytecode Viewer 3.0 by ej-technologies and Classfile Inspector 2.0 by Industrial Software Technology.
Introduction
Recently I faced with a need to inspect a Java bytecode in order to create a tests for bytecode processing application. Googling around showed that the market of the bytecode viewers is narrow and actually there is no large variety of possibilities to choose from.
Viewing Java bytecode generated from the Java source is not too common task for most Java developers, so the choice of the tools in this area is quite narrow. In addition to the bytecode viewers discussed here I’ve found the following additional tools:
- ASM Bytecode Outline plugin for Eclipse – provides an ability of viewing bytecode instructions for current method and/or ASMfied view of the method code.
- JavaP plugin for Intellij IDEA – last updated in June 2003, seems to be dead project.
- JProfiler by ej-technologies – Java profiling application claims to have a bytecode presentation feature when integrated with IDE like Intellij IDEA (probably it uses Jclasslib as underlying library).
Feature comparison table
| Jclasslib Bytecode Viewer 3.0 | Classfile Inspector 2.0 | |
| General | ||
| Pricing | Free |
10�-99� per license (depends on license amount), free for students and teachers |
| License | GPL | Commercial |
| Supported platforms | Windows, Linux, Unix, Mac OS X 10.1/2 | Windows, Linux and others (as plugin) |
| Installation | Platform-specific installation package | Jar file. Requires write privileges |
| Available plugins | NetBeans module | Eclipse 3.1 (and higher) plugin |
| Standalone version | Yes | No |
| Java versions supported | 1.5 | 1.5 |
| Usability | Works smoothly | Changing default output directory breaks an ability of viewing *.class file corresponding to java source |
| Features | ||
| Presentation | Application windows | Text file |
| Bytecode hierarchy presentation | Application window | “Outline” Eclipse view |
| Hierarchy link with bytecode editor | Yes | Yes |
| Viewing standalone *.class files | No | Yes |
| Exploring *.jar files | Yes | Yes |
| Binary data presentation | No | Yes |
| Bytecode presentation | Yes. Separate presentation for each type (methods, fields, exceptions etc.) | Yes. All-in-one text file containing binary data, bytecode instruction presentation and source code |
| Java source presentation | No | If available in project |
| Bytecode decompilation | No | No |
| Bytecode modification | No | Yes |
| Bytecode validation | No | No |
| Links inside bytecode | Yes | No |
| Export | Method bytecode instructions can be copied to clipboard | As any text file |
Pros and cons
Jclasslib Bytecide Viewer 3.0
Pros:
- Availability as a standalone application
- Links inside bytecode presentation
Cons:
- Limited export ability
- No binary data presentation
- No source code presentation
Classfile Inspector 2.0
Pros:
- Eclipse integration
- Mixed binary, instructions and java source presentation
- Bytecode modification
Cons:
- No available as standalone application
- Limited usability
Summary
Classfile Inspector 2.0 is a very powerful bytecode viewer application, with good presentation features, giving an ability of inspecting bytecode created by compiler as a derivative of java source code. This provides a user with an opportunity to understand deeply the way bytecode is generated and the affects of different coding decisions on actual code execution. It looks to be an ultimate helper for anyone teaching or studying Java. The main application disadvantage is its tight binding to Eclipse platform, making it almost useless for those working with any other Java IDE.
Jclasslib Bytecide Viewer 3.0 is a good tool for developer that needs just an inspection view on the jar files containing bytecode created, with no ability to modify it or to follow the influence of source code changes on the bytecode generated. Plugins for IDEs other that NetBeans would be nice, even it always can be used as a standalone application.
One Response
Yo all, long time browser first time poster here
glad to be a member, and I look forward to begin getting more active here
In the mean time check out my site http://wrestlesphere.com/uniquearticlewriting/?p=5