原文地址:Integrating JAD decompiler into JDeveloper

In JDeveloper, when debugging or otherwise navigating to classes that JDeveloper does not have the source code for, JDeveloper generates a "stub source", showing you only the fields and methods but not the source code. For many years, I have been using a neat "undocumented feature" of JDeveloper, which allows me to integrate the popular decompiler JAD into the IDE, so that I automatically get JAD decompiled code instead of those rather useless stub sources. Recently I wanted to use this feature on someone else’s computer, and, not having my laptop present, I tried Googling for this "undocumented feature", which lived up to its name insofar that I could not find it anywhere. So, before I have a harddisk crash and lose this knowledge for good, I’ll put it in this blog entry

First step is to dowload the free JAD decompiler, which you can find at this location: http://www.kpdus.com/jad.html#download. There is no installation process to speak of, it contains a single executable (jad.exe in case of Windows) which you can place anywhere on your harddisk. Then, you’ll need to go to open the file "<JDEV_HOME>\jdev\bin\jdev.conf", and add the red lines below to it:

##############################################################################
#
# Oracle JDeveloper 10g Launcher Configuration File
# Copyright - Oracle Corporation.
# All Rights Reserved.
#
##############################################################################
#
# The format of this file is:
#
# "Directive Value" (with one or more spaces and/or tab characters
# between the directive and the value) This file can be in either UNIX
# or DOS format for end of line terminators. Any path seperators must be
# UNIX style forward slashes '/', even on Windows.
#
# ADDED BY PEBELL
AddVMOption -Djcncmd=c:/progra~/decomp/jad.exe -& -p -b -ff -nl -pi99999 -space -t2 -noinner
SetBuiltRoot ../../built
AddJavaLibPath ../lib/patches
AddJavaLibFile ../../../classes

Of course, you need to use your own path to where you placed the jad.exe file. The "-p" parameter is mandatory (indicating that JAD needs to write its output (the decompiled source code) to STDOUT, which JDeveloper pipes to the editor window. The rest of the parameters guide the way in which JAD decompiles the code, and are a matter of personal preference. In this example, it indicates that it will use more braces than strictly necessary (for readability), fields will be put above the methods, String constants will break at newlines, imports will not be grouped, spaces will be placed between keywords (like "if") and expressions, indentation size = 2 spaces, and inner classes need not be decompiled. But there’s much more to choose from.

There is, however, one small caveat: when decompiling certain classes, JDeveloper seems to "lock up", in which case you have to kill the jdev.exe process manually and relaunch JDeveloper. Despite this instability (which might be cured with additional JAD parameters, SEE UPDATE BELOW)  I find this a very useful feature (or customization, or hack, whichever you prefer)! Check it out!

UPDATE

I seem to have found the cause of the instability problem. When using JAD from the command line on one of the "troublesome classes" that lock up JDeveloper, I noticed that some "debug messages" were written to STDERR:

Overlapped try statements detected. Not all exception handlers will be resolved in the method init
Couldn't fully decompile method init
Couldn't resolve all exception handlers in method init

Using the -& JAD option (which I just added to the jdev.conf line above), JAD redirects STDERR to STDOUT. The result when using JAD inside JDeveloper is that these messages are written to the decompiled code (where you get to see them), and that JDeveloper no longer locks up. Happy decompiling!

附:Jad下载地址

Integrating JAD decompiler into JDeveloper(转)的更多相关文章

  1. How to decompile class file in Java and Eclipse - Javap command example(转)

    Ability to decompile a Java class file is quite helpful for any Java developer who wants to look int ...

  2. Java反编译利器-Jad, Jode, Java Decompiler等及其IDE插件

    转自:http://blog.csdn.net/superbeck/article/details/5189231 对于长年使用Java的程序员,大部分应该都会或多或少的使用到反编译软件.毕竟,不可能 ...

  3. Myeclipse8.5 反编译插件 jad 安装

    准备工作 下载jad.exe文件和下载jadeclipse插件:http://pan.baidu.com/s/1pJKjVwn JadClipse 官网:http://jadclipse.source ...

  4. 使用 DJ Java Decompiler 将整个jar包反编译成源文件

    使用 DJ Java Decompiler 将整个jar包反编译成源文件 所使用的软件是 DJ Java Decompiler 3.9. 下面是一个有用的参考文档,说明如何批量编译 http://ww ...

  5. Eclipse反编译工具Jad及插件JadClipse配置

    Jad是一个Java的一个反编译工具,是用命令行执行,和通常JDK自带的java,javac命令是一样的.不过因为是控制台运行,所以用起来不太方便.不过幸好有一个eclipse的插件JadClipse ...

  6. 【转】Eclipse Class Decompiler——Java反编译插件

    闲暇之余,写了一个Eclipse下的Java反编译插件:Eclipse Class Decompiler,整合了目前最好的2个Java反编译工具Jad和JD-Core,并且和Eclipse Class ...

  7. view class source code with JAD plugin in Eclipse

    The default class viewer doesn't decompile the class file so you cannot open and check the source co ...

  8. myeclipse 反编译插件 jad 安装

    1.  准备工作 下载jad.exe文件:http://www.varaneckas.com/sites/default/files/jad/jad158g.win.zip 下载jadeclipse插 ...

  9. Eclipse反编译工具Jad及插件JadClipse配置(转)

    Eclipse反编译工具Jad及插件JadClipse配置 Jad是一个Java的一个反编译工具,是用命令行执行,和通常JDK自带的java,javac命令是一样的.不过因为是控制台运行,所以用起来不 ...

随机推荐

  1. UITabBarController QQ

    AppDelegate.m #import "AppDelegate.h" #import "FirstViewController.h" #import &q ...

  2. 通过StoryBoard加载视图控制器问题

    如果通过拉线的方式拉进来一个UIViewController,再将它绑定一个UIViewController类.创建的时候通过alloc,init创建出来并不会创建出一个你拉进来的UIViewCont ...

  3. 让div中的table居中

    div 标签上写  style="text-align:center" div中的table中写 style="margin:auto;"  <table ...

  4. Linux学习书目

    Linux基础 1.<Linux与Unix Shell 编程指南> C语言基础 1.<C Primer Plus,5th Edition>[美]Stephen Prata著 2 ...

  5. Android分辨率适配心得

    关于Android分辨率适配,这个是Android开发很头疼的一个问题,也需要花费相当一部分开发时间处理的一个问题,往往一个界面怎么适配就得想半天,特别是新手,也经常有人问我是怎么适配分辨率的,我也不 ...

  6. 获取微信openID 的步骤

    获取微信openid的步骤:1.进入-->判断openID是否为空: 空-->$url=urlencode("http://xxx/xxx.php");//回调链接 $ ...

  7. 为 Virtual Box 中的 CentOS 6.6 配置本地DVD光盘做yum软件源

    因为virtual box 中的centos配置host-only共享win7上网,配置失败,所以只能使用Centos的 DVD 光盘来配置yum软件源.不然就没得完了. 1. 首先要在virtual ...

  8. 在VS项目中使用SVN版本号作为编译版本号

    在实际项目中(特别是作为产品的项目),版本号是必不可少的一部分.版本号的规则也有许多种,在此不讨论具体的编码规范.对于迭代的产品,版本繁多,特别是有多个实施项目所使用产品的版本不同(基于定制需求)时, ...

  9. nginx 负载均衡示例

    一.nginx nginx是一个轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,以开源形式发布.nginx的性能稳定,功能丰富,配置简单,且占用系统资源低.可支持多个 ...

  10. SecureCRT 使用技巧

    VanDyke CRT 和 VanDyke SecureCRT是最常用的终端仿真程序,简单的说就是windows下登录UNIX或Liunx服务器主机的软件.二者不同的是SecureCRT支持SSH∗( ...