Integrating JAD decompiler into JDeveloper(转)
原文地址: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(转)的更多相关文章
- 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 ...
- Java反编译利器-Jad, Jode, Java Decompiler等及其IDE插件
转自:http://blog.csdn.net/superbeck/article/details/5189231 对于长年使用Java的程序员,大部分应该都会或多或少的使用到反编译软件.毕竟,不可能 ...
- Myeclipse8.5 反编译插件 jad 安装
准备工作 下载jad.exe文件和下载jadeclipse插件:http://pan.baidu.com/s/1pJKjVwn JadClipse 官网:http://jadclipse.source ...
- 使用 DJ Java Decompiler 将整个jar包反编译成源文件
使用 DJ Java Decompiler 将整个jar包反编译成源文件 所使用的软件是 DJ Java Decompiler 3.9. 下面是一个有用的参考文档,说明如何批量编译 http://ww ...
- Eclipse反编译工具Jad及插件JadClipse配置
Jad是一个Java的一个反编译工具,是用命令行执行,和通常JDK自带的java,javac命令是一样的.不过因为是控制台运行,所以用起来不太方便.不过幸好有一个eclipse的插件JadClipse ...
- 【转】Eclipse Class Decompiler——Java反编译插件
闲暇之余,写了一个Eclipse下的Java反编译插件:Eclipse Class Decompiler,整合了目前最好的2个Java反编译工具Jad和JD-Core,并且和Eclipse Class ...
- 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 ...
- myeclipse 反编译插件 jad 安装
1. 准备工作 下载jad.exe文件:http://www.varaneckas.com/sites/default/files/jad/jad158g.win.zip 下载jadeclipse插 ...
- Eclipse反编译工具Jad及插件JadClipse配置(转)
Eclipse反编译工具Jad及插件JadClipse配置 Jad是一个Java的一个反编译工具,是用命令行执行,和通常JDK自带的java,javac命令是一样的.不过因为是控制台运行,所以用起来不 ...
随机推荐
- 【读书笔记】iOS-Objective-C对C的扩展基础知识
一,Xcode的.m扩展名表示文件含有Objective-C代码,应由Objective-C编译器处理.C编译器处理名称以.c结尾的文件,而C++编译器处理.cpp文件.在Xcode中,所有这些编译工 ...
- Linux学习书目
Linux基础 1.<Linux与Unix Shell 编程指南> C语言基础 1.<C Primer Plus,5th Edition>[美]Stephen Prata著 2 ...
- Hibernate之Criteria的完整用法
Criteria的完整用法 QBE (Query By Example) Criteria cri = session.createCriteria(Student.class); cri.add(E ...
- informatica 厂商培训资料
1.informatica中domain与node的理解: domain 类似于局域网,node就是局域网中的节点或者计算机. node应与repository在数据库中存储在不同的scheme中,此 ...
- 字符串_KMP算法(求next[]模板 hdu 1711)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1711 问题描述:给两个序列a,b,长度分别为n,m(1<=n<=1000000,1< ...
- poj 3694 Network 边双连通+LCA
题目链接:http://poj.org/problem?id=3694 题意:n个点,m条边,给你一个连通图,然后有Q次操作,每次加入一条边(A,B),加入边后,问当前还有多少桥,输出桥的个数. 解题 ...
- nyoj 139 我排第几个--康拓展开
我排第几个 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 现在有"abcdefghijkl”12个字符,将其所有的排列中按字典序排列,给出任意一种排列,说 ...
- js 操作select和option
js 操作select和option 1.动态创建select function createSelect(){ var mySelect = document.createElement_x(&qu ...
- How to use python remove the '^M' when copy words from Windows to Linux
今天帮同事用Python写了一个小工具,实现了在linux下批量文件名和去掉windows 文件到linux过程中产生^M的脚本,代码如下: !/opt/exptools/bin/python imp ...
- 在VMware上安装CentOS-6.5 minimal - 配置网络
CentOS的minimal版本默认不启动网络,所以安装完CentOS要自己配置网络. 老伯的VMware虚拟机网络连接方式采用NAT方式(其他方式没试过). 1 修改配置文件/etc/sysconf ...