
Thursday October 19, 2006
NBJAD (simple integration with Jad decompiler) module uploaded
I have uploaded the NBJAD Module to my Netbeans update center described here.
This module integrates the popular Jad Decompiler with the Netbeans IDE. This module provides the following action:
| Action |
Key binding |
| Decompile |
Ctrl-F9 |
How to configure Jad
Download the Jad decompiler from
here, install it and configure the location in the
Tools:Options:Decompile panel (see screenshot below). Make sure you read and follow the Jad license.
How it works
When the
View:Decompile action or the
Decompile action in the pop up menu is invoked on the selected
.class file node the Jad decompiler is invoked on it with the following options:
jad -o -r -s .java -d <user.home>/.nbjad [additional jad options] .class-file
where:
-o - overwrite the output files
-r - create folder structure consistent with package specified in the .class file
-s - suffix for output files i.e. .java. This trick makes the Netbeans Java editor simply work.
-d - output directory. This can be overridden with the System property
"org.netbeans.modules.java.tools.nbjad.output.directory"
The output window shows the status of decompilation. Decompile action in the pop up menu is not available on the .class files inside a jar file. However View:Decompile action can still be used.
If the .class file is inside a jar file it is first copied to the disk under the System.getProperty("user.home") + File.separator + ".nbjad" folder. The copied file is marked for deletion on vm exit.
The decompiled .java file is output to a folder, consistent with the package specified in the .class, under the System.getProperty("user.home") + File.separator + ".nbjad". folder. The output .java file is opened in a Netbeans Java Editor tab.
The following additonal options can be specified:

TODO
- Open decompiled files in read-only mode
- Add action to clean up all decompiled files
- Add decompilation output folder to the Favorites - DONE. This way you can easily get back to previously decompiled files.
Sources
DISCLAIMER: This module is experimental. So no guarantees. Use the module at your own risk.
Posted by sandipchitale
( Oct 19 2006, 10:42:59 PM PDT ) Permalink