博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Java代码反编译——下载class字节码文件及反编译.class文件
阅读量:4227 次
发布时间:2019-05-26

本文共 390 字,大约阅读时间需要 1 分钟。

我们在学习动态代理的实现原理时往往希望能够将字节码文件反编译出来看一下代理类时如何调用handler的invoke方法来实现代理的,但是往往我们不知道如何下载字节码文件,或者下载来不知道下载路径,又或者使用javap反编译出来的结构并不是我们想要的,那么根据一下步骤可以轻松的得到字节码的反编译结果:

  1. 设置System.getProperties().put("sun.misc.ProxyGenerator.saveGeneratedFiles", "true");或者在VMoptions中加入参数-Dsun.misc.ProxyGenerator.saveGeneratedFiles=true可以保存生成的动态代理类的class文件,生成的代理class文件在工程根目录的com\sun\proxy中。(JDK1.8)
  2. 反编译class文件(选择CFR反编译结果更可靠):

 

转载地址:http://csnqi.baihongyu.com/

你可能感兴趣的文章
Visual SourceSafe 2005 Software Configuration Management in Practice
查看>>
Beginning EJB 3 Application Development: From Novice to Professional
查看>>
Google Web Toolkit: GWT Java Ajax Programming
查看>>
Breakthrough Windows Vista(TM): Find Your Favorite Features and Discover the Possibilities
查看>>
Windows Powershell in Action
查看>>
Functional And Object Oriented Analysis And Design: An Integrated Methodology
查看>>
The Debugger's Handbook
查看>>
Using Samba
查看>>
XML Security
查看>>
Rails Cookbook
查看>>
Dynamic HTML: The Definitive Reference (Dynamic Html) [ILLUSTRATED]
查看>>
Python (Visual QuickStart Guide)
查看>>
SCJP Sun Certified Programmer for Java 5 Study Guide
查看>>
Building the Perfect PC [ILLUSTRATED]
查看>>
Pro .NET 2.0 Windows Forms and Custom Controls in VB 2005
查看>>
The Definitive Guide to Berkeley DB XML
查看>>
The Concordance Database Manual (Expert's Voice)
查看>>
Beginning Google Maps Applications with PHP and Ajax: From Novice to Professional
查看>>
Expert Service-Oriented Architecture in C# 2005, Second Edition
查看>>
Beginning SharePoint with Excel: From Novice to Professional
查看>>