Myeclipse的反編譯插件介紹

在平時的項目中,經常需要開一下別人寫的源碼,而此時別人提供的往往是jar文件,根本看不了,很是不爽。最近很偶然的看見一個同事在eclipse下查看class文件,很是興奮。下面講下是如何安裝下插件的。

打開class文件,我目前瞭解的有2種類型的軟件:
一、在eclipse外部打開jar文件。
Java Decompiler.exe,主頁JD home page: http://java.decompiler.free.fr ,該軟件可以打開整個jar包,功能很強大。

二、在eclipse內部打開jar文件。
net.sf.jadclipse_3.3.0.jar、jad158g.win.zip,需要這兩個文件。
準備工作:
1、下載jad.exe文件:http://www.varaneckas.com/jad
2、下載jadeclipse插件:http://sourceforge.net/projects/jadclipse/files/

安裝如下:

1、將jadeclipse插件net.sf.jadclipse_3.3.0.jar 拷貝到myeclipse安裝目錄E:\MyEclipse 6.0\eclipse\myplugins\jad\eclipse\plugins目錄下,並在目錄E:\MyEclipse 6.0\eclipse\links下新建文件jad.link,內容如下path=E:\\MyEclipse 6.0\\eclipse\\myplugins\\jad\\ 

2、將jad.exe解壓到指定目錄。如:D:\tools 

3、在eclipse窗口下,點擊Window > Preferences > Java > JadClipse > Path to Decompiler。(設置jad的絕對路徑,如 D:\tools\jad\jad.exe)。Use Eclipse code formatter(overrides Jad formatting instructions)選項打勾,與格式化出來的代碼樣式一致。

4、在eclipse窗口下,點擊Window > Preferences > Java > JadClipse > Misc,將Convert Unicode strings into ANSI strings選項打勾,避免反編譯後可能出現的中文亂碼。

5、重新啓動myeclipse,eclipse自動將JadClipse Class File Viewer設置成class文件的缺省打開方式。如果沒有默認,可以在Eclipse的Window > Preferences >General >Editors> File Associations中修改“*.class”默認關聯的編輯器爲“JadClipse Class File Viewer”。設置完成後,雙擊*.class文件,eclipse將自動反編譯。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章