myeclipse8.5反编译插件的安装使用jdgui插件

在实际的工作中,可能会用到反编译工具,尤其对于定制的myeclipse开发平台,很多的公共方法都进行二次分装,无法直接查看,通过本插件的安装,可以直接点击查看分装在jar包中的class文件,这对学习SSH的源码包提供了一定的方便。

注意:本人安装了该插件,导致myeclipse的SVN版本工具无法使用,特此声明,需要提前进行备份myeclipse。

安装环境为myeclipse8.5,请注意

首先下载反编译工具的安装包:

http://java.decompiler.free.fr/jd-eclipse/update/jdeclipse_update_site.zip

将下载的压缩包拷贝到myeclipse的安装目录下(推荐,因为该目录平台不做修改,放置到其他地方需要小心被删除)

在这里需要用到这么一个JAVA类:

 1 import java.io.File;
2 import java.util.ArrayList;
3 import java.util.List;
4
5 public class CreatePluginsConfig {
6 private String path;
7
8 public CreatePluginsConfig(String path) {
9 this.path = path;
10 }
11
12 public void print() {
13 List list = getFileList(path);
14 if (list == null) {
15 return;
16 }
17 int length = list.size();
18 for (int i = 0; i < length; i++) {
19 String result = "";
20 String thePath = getFormatPath(getString(list.get(i)));
21 File file = new File(thePath);
22 if (file.isDirectory()) {
23 String fileName = file.getName();
24 if (fileName.indexOf("_") < 0) {
25 continue;
26 }
27 String[] filenames = fileName.split("_");
28 String filename1 = filenames[0];
29 String filename2 = filenames[1];
30 result = filename1 + "," + filename2 + ",file:/" + path + "\\"
31 + fileName + "\\,4,false";
32 System.out.println(result);
33 } else if (file.isFile()) {
34 String fileName = file.getName();
35 if (fileName.indexOf("_") < 0) {
36 continue;
37 }
38 int last = fileName.lastIndexOf("_");// 最后一个下划线的位置
39 String filename1 = fileName.substring(0, last);
40 String filename2 = fileName.substring(last + 1, fileName
41 .length() - 4);
42 result = filename1 + "," + filename2 + ",file:/" + path + "\\"
43 + fileName + ",4,false";
44 System.out.println(result);
45 }
46 }
47 }
48
49 public List getFileList(String path) {
50 path = getFormatPath(path);
51 path = path + "/";
52 File filePath = new File(path);
53 if (!filePath.isDirectory()) {
54 return null;
55 }
56 String[] filelist = filePath.list();
57 List filelistFilter = new ArrayList();
58 for (int i = 0; i < filelist.length; i++) {
59 String tempfilename = getFormatPath(path + filelist[i]);
60 filelistFilter.add(tempfilename);
61 }
62 return filelistFilter;
63 }
64
65 public String getString(Object object) {
66 if (object == null) {
67 return "";
68 }
69 return String.valueOf(object);
70 }
71
72 public String getFormatPath(String path) {
73 path = path.replaceAll("\\\\", "/");
74 path = path.replaceAll("//", "/");
75 return path;
76 }
77
78 public static void main(String[] args) {
79 new CreatePluginsConfig(
80 "D:\\Program Files\\Genuitec\\MyEclipse 8.5 M1\\jdeclipse_update_site\\plugins")
81 .print();// 注意此路径就是你安装插件的路径,根据自己的具体路径设置
82 }
83 }

该类的下载地址:http://dl.dbank.com/c029r2r7yv

只需在最后的几行中,把自己的减压的插件的路径拷贝进入,点击run,运行:

前面的四行针对的不是windows操作系统的,不必理会,主要是后面三行。

将最后三行拷贝:

找到myeclipse中的该路径

MyEclipse 8.5 M1\configuration\org.eclipse.equinox.simpleconfigurator

,打开bundles.info文件,将之前的三行数据拷贝到最后(建议用editplus打开)

打开之前,需要备份bundles.info文件,防止出现意外,当出现错误信息后,直接覆盖源文件即可

接下来,在myeclipse中进行配置:

保存,重启myeclipse即可(假如之前打开):

反编译成功,通过该工具,大家可以快速的SSH的源码。

---------------------end

I believe that we are who we choose to be. Nobody‘s going to come and save you, you‘ve got to save yourself. 我相信我们成为怎样的人是我们自己的选择。没有人会来拯救你,你必须要自己拯救自己。
原文地址:https://www.cnblogs.com/caroline/p/2348442.html