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-GCD-block-后台运行
			当一个app按home键退出的时候,只有最多5秒的时间做一些保存或清理资源的工作.但是调用beginBackgroundTaskWithExpirationHandler方法,可以最多有10分时间在后 ... 
- Quartz2D学习笔记
			1.drawRect方法 //1.证明drawRect方法是在viewDidLoad后自动调用的,方便处理View的相关属性 // YQView * view = [[YQView alloc] in ... 
- MyBatis入门(一)---基本使用
			一.MyBatis简介 1.1.概述 MyBatis 是支持定制化 SQL.存储过程以及高级映射的优秀的持久层框架. MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集. M ... 
- 自己使用    1.C语言历史以及特点。
			1. C语言的发展及特点? C在1969--1973年间与Unix操作系统同时诞生:最富创造性的时期是1972年.另一次大的变化发生在1977到1979年间,当Unix系统的可移植性得到证明时.在后一 ... 
- android  短信助手demo
			关于意图Intent: 显式意图:必须指定要激活的组件的完整包名和类名(应用程序之间耦合在一起) 一般激活自己应用的组件的时候采用显式意图 隐式意图:只需要指定动作和数据就可以(好处是应用程序之间没有 ... 
- eval 为什么加括号
			<!DOCTYPE html> <html> <head> <title>eval学习</title> <script type=&q ... 
- 记录Hibernate的缓存知识
			一.Hibernate缓存的作用 Hibernate是一个持久层框架,Hibernate要经常访问物理数据库.为了降低应用程序对物理数据源访问的频次,从而提高应用程序的运行性能,Hibernate的缓 ... 
- linux 后台运行进程  fg  bg  ctrl+z nohup
			fg.bg.jobs.&.nohup.ctrl+z.ctrl+c 命令 一.& 加在一个命令的最后,可以把这个命令放到后台执行,如 watch -n 10 sh test.sh &am ... 
- redis中set命令的源码分析
			首先在源码中的redis.c文件中有一个结构体:redisCommand redisCommandTable[],这个结构体中定义了每个命令对应的函数,源码中的set命令对应的函数是setComman ... 
- [转+原]chrony
			greenplum,openstack等云计算项目需要集群服务器部署,服务器之间的时间需要同步,但并不是所有机器可以 直接连外网,这时可以用Chrony工具解决. 解决方法是将其中一台设为时间服务器, ... 
