Jodeclipse 是Jode的Eclipse外掛程式,JadClipse是Jad的Eclipse外掛程式,它們都是非常好的反編譯外掛程式。
Jode Eclipse Plugin 1.0.5 for Eclipse version 3.1 / 3.2
安裝方法
(1)從如下地址下載:
http://sourceforge.net/projects/jodeeclipse
把下載下來的檔案jodeplugin_1.0.5.zip直接解壓到eclipse的plugins目錄下。
(2)啟動eclipse,help -> Software Updates-> Find and Install... -> Search for new features to install,單擊"New Remote Site..." 在URL欄輸入 http://www.technoetic.com/eclipse/update然後下一步,就可以看到“jode decompiler plugin *.*”,選上安裝就可以了。安裝好後可以看到Window -> Preferences...-> Java -> Jode Decompiler選項卡,okay,安裝成功了。
配置:Window-> Preferences... -> General -> Editors -> File Associations找到"*.class"在"Associated editors"裡面可以看到"Jode class file viewer"選中它再單擊Default按鈕.
JadClipse Eclipse Plugin for Eclipse version 3.1 / 3.2/3.3
一、下載:
下載外掛程式:
下載jadclipse_3.1.0.jar版本,該版本支援eclipse3.1M6~3.2M2
下載jadclipse_3.2.0.jar版本,該版本支援eclipse3.2M3和eclipse3.2M4.
下載jadclipse_3.2.4.jar版本,該版本支援eclipse3.2M5~3.3M5
下載jadclipse_3.3.0.jar版本,該版本支援eclipse3.3M6以上版本
下載Jad反編譯工具:
http://www.kpdus.com/jad.html#download,在該頁中找到適合自己作業系統平台的jad下載。下載後解壓,然後將解壓後的jad.exe檔案複製到%JAVA_HOME%/bin目錄下面(可以將jad.exe放到任意位置,只要記住其存放路徑就好,下面要用到)。
二、安裝:
Eclipse中的外掛程式安裝可以參考:Eclipse提示
方法1、直接將jadclipse_x.x.x.jar(x.x.x.代表版本號碼)複製到%ECLIPSE_HOME%/plugins目錄下。
方法2、使用link方式安裝,建立D:/Myplugins/jadclipse3.2.4/eclipse/plugins的目錄結構,將jadclipse_3.2.4.jar放到plugins目錄下面(註:其中D:/Myplugins為你自己定義的一個專門放置外掛程式的目錄)。再在%ECLIPSE_HOME%/links目錄下面建立一個jadclipse3.2.4.link檔案(該檔案名稱隨便取)。檔案裡面內容為:path=D:/Myplugins/jadclipse3.2.4.
三、使用:
啟動eclipse,點擊反編譯的類檔案,此時會啟用jadclipse外掛程式,在eclipse菜單中會多出一個jadclipse菜單,如所示:
jadclipse外掛程式
一般地它會自動反編譯相應的class檔案,如果沒有自動反編譯,請點擊jadclipse->Decompile
如所示:
jadclipse外掛程式反編譯
常見問題及解決:
(一)啟動eclipse,開啟Window->Preferences->Java->JadClipse,如果沒有找到JadClipse,即JadClipse外掛程式沒有啟用。
(1)檢查外掛程式安裝的版本是否與你安裝的eclipse版本對應
(2)使用 –clean參數來啟動eclipse
(二)在使用JadClipse外掛程式反編譯class檔案時出現如下類似錯誤:
/*jadclipse*/
/*
DECOMPILATION REPORT
Decompiled from: E:/Java/jre1.5.0_12/lib/ext/j3dutils.jar
Total time: 63 ms
Jad reported messages/errors:
Exit status: 0
Caught exceptions:
java.io.IOException: CreateProcess: E:/Java/jdk1.5.0_12 -p -t4 -lradix10 -radix10 KeyNavigator.class error=5
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at net.sf.jadclipse.JadDecompiler.decompile(JadDecompiler.java:160)
at net.sf.jadclipse.JadDecompiler.decompileFromArchive(JadDecompiler.java:217)
at net.sf.jadclipse.JadclipseSourceMapper.findSource(JadclipseSourceMapper.java:150)
at net.sf.jadclipse.JadclipseSourceMapper.findSource(JadclipseSourceMapper.java:83)
at net.sf.jadclipse.JadclipseClassFileEditor.doOpenBuffer(JadclipseClassFileEditor.java:87)
at net.sf.jadclipse.JadclipseClassFileEditor.doSetInput(JadclipseClassFileEditor.java:45)
at net.sf.jadclipse.JadclipseActionBarContributor.setActiveEditor(JadclipseActionBarContributor.java:87)
at org.eclipse.ui.internal.EditorActionBars.partChanged(EditorActionBars.java:335)
at org.eclipse.ui.internal.WorkbenchPage$3.run(WorkbenchPage.java:606)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.WorkbenchPage.activatePart(WorkbenchPage.java:595)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3203)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:588)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2604)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2528)
at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2520)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2505)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2500)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2485)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:287)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:164)
at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:49)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:190)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:174)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:267)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:243)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:306)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:653)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:817)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:815)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1069)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1168)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:249)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:243)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:283)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
*/
請確保你的Jad路徑在eclipse中正確制定。
啟動eclipse,開啟:Window->Preferences->Java->JadClipse.
1、Path to decompiler,這裡設定反編譯工具jad的全路徑名,比如:%JAVA_HOME%/bin/jad.exe.
2、Directory for temporary files,這裡設定臨時檔案路徑。
至於Window->Preferences->Java->JadClipse目錄下的Debug,Directives,Formatting,Misc目錄中的參數設定,就不再羅嗦了。
(三)安裝完成後,eclipse沒有自動將JadClipse Class File Viewer設定成class檔案的預設開啟檔案。
如果沒有預設,可以在Eclipse的Windows—> Perference—>General->Editors->File Associations中修改“*.class”預設關聯的編輯器為“JadClipse Class File Viewer”。設定完成後,雙擊*.class檔案,eclipse將自動反編譯。
(三)Eclipse中外掛程式的安裝