
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
Trackback URL: http://blogs.sun.com/scblog/entry/nbjad_simple_integration_with_jad
Posted by 192.18.43.249 on October 20, 2006 at 08:33 AM PDT #
You may be confusing NBJAD with similarly named NBJHAT (running OQL queries on heap dump files generated by jmap). If not, please let me know what is not working for you with NBJAD module. It is true that NBJHAT works with JDK1.6 only.
Posted by Sandip on October 20, 2006 at 09:00 AM PDT #
https://nb-jode-jad-module.dev.java.net/
Posted by Ramón on October 20, 2006 at 09:43 AM PDT #
BTW the link should be:
https://nb-jode-jad-module.dev.java.net/
Posted by Sandip on October 20, 2006 at 10:03 AM PDT #
Posted by 192.18.43.249 on October 20, 2006 at 10:46 AM PDT #
NBJHAT, a different module on my update center is dependent on JDK6.
Posted by Sandip on October 20, 2006 at 11:18 AM PDT #
Posted by goldy on November 21, 2006 at 08:25 AM PST #
Posted by Sandip on November 21, 2006 at 08:50 AM PST #
Posted by goldy on November 22, 2006 at 01:24 AM PST #
Posted by Dan on January 11, 2007 at 04:49 PM PST #
Posted by Dan on January 11, 2007 at 06:35 PM PST #
Your idea about the jar file sounds interesting. I will look into it.
Actually you can change the output directory settings by setting the System property:
in the netbeans.conf file.About Ctrl+F9 - I chose it to shadow F9 for Compile File. I did not realize that it conflicts with evaluate expression. You can always change the settings in Tools:Options:KeyMap:Other category.
Posted by Sandip on January 11, 2007 at 06:52 PM PST #
Great work you're doing, Sandip.
Works great in my NetBeans IDE.
Posted by Marvin on September 23, 2007 at 10:47 AM PDT #
Thanks for this module! Works great for me, too.
I use NB5.5.1 and jdk1.6.0
BTW:
I restarted the IDE to see the decompiler menu in options dialog...
Posted by Peter Karich on October 09, 2007 at 12:20 AM PDT #
Thanks Peter. About requiring the IDE restart to see the decompiler menu - I have seen that happen sometimes. I will look into it.
BTW if you downloaded the module from my blog's update centre, a
later version may be available here:
http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=117
7
Posted by Sandip on October 09, 2007 at 05:57 AM PDT #