我的设置方法:
1、我用是MyEclipse6.5,使用的jad为jd-gui-0.2.10.windows.zip,插件用的是net.sf.jadclipse_3.3.0.jar。
2、具体的设置步骤是:
(1)jd-gui-0.2.10.windows.zip解压后的jd-gui.exe放在D:\Program Files\Java\jre1.5.0_06\bin目录下(也曾试过放在D:\Program Files\Java\jdk1.5.0_06\bin),不过这个放置的位置可以自己定,只要记住就行。
(2)把net.sf.jadclipse_3.3.0.jar包复制到D:\MyEclipse 6.5\eclipse\plugins下,对于这一步骤,网上大多说法是针对eclipse的,说是要放在%ECLIPSE_HOME%\plugin下,我不知道我放的这个位置对不对,不过也试过放在其他的plugin目录下。
(3)启动MyEclipse6.5,在windows->preferences中的确多出一个JadClipse(见附件1.png),在这个目录下做了相应设置(见附件2.png)
(4)在windows->oreferences->General->Editors->File Associations中,.class文件的关联编辑器已自动设为:"JadClipse Class File Viewer”。
3、最后,按住ctrl,点击类名时打开的.class出现如下信息:
/*jadclipse*/
/*
DECOMPILATION REPORT
Decompiled from: D:\repository\com\huawei\bme\dcp\bme-dcp-commons\R001C01-SNAPSHOT\bme-dcp-commons-R001C01-SNAPSHOT.jar
Total time: 0 ms
Jad reported messages/errors:
Exit status: 0
Caught exceptions:
java.io.IOException: CreateProcess: jad -p -t4 -lradix10 -radix10 BMEException.class error=2
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
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:629)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at org.eclipse.ui.internal.WorkbenchPage.activatePart(WorkbenchPage.java:618)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3398)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:611)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2748)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2651)
at org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPage.java:2643)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2595)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2590)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2574)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2565)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:299)
at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:173)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:194)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:175)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:268)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:244)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:316)
at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$5.open(PackageExplorerPart.java:613)
at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:820)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:199)
at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:818)
at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1079)
at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1183)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:263)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:257)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:297)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
*/
我在网上找了很久,对MyEclipse中安装反编译插件的方法大同小异,我也没有找到我这个问题的解决方法,希望有知道的同志不吝赐教!!如果我有什么地方没有描述清楚的,请告诉我,我好补充。