myeclipse和eclipse安装Java反编译插件

时间:2023-12-02 09:46:14

为myeclipse和eclipse安装Java反编译插件

 插件所需包

1.解压jad1.5.8g.zip.将jad.exe放到jre的bin目录下,下载地址: http://ishare.iask.sina.com.cn/f/15708995.html?from=dl

如笔者在D:\program files\Java\jre6\bin下

2.安装jadeclipse 下载地址 http://jaist.dl.sourceforge.net/sourceforge/jadclipse/net.sf.jadclipse_3.3.0.jar

将jadclipse_3.1.0.jar复制插件目录
个人机器上环境为myeclipse版本为7.5,eclipse版本为3.3.其它版本方式一致.
eclipse安装目录的\plugins目录下,如笔者:D:\program files\eclipse\plugins
myeclipse拷贝到Common\plugins目录下,如笔者:D:\program files\Genuitec\Common\plugins

对于eclipse安装

如下: Windows —>  Perference —> Java下面应该会多出一个JadClipse目录,,相关的设置可以在此修改配置jadclipse:
myeclipse和eclipse安装Java反编译插件

设置path to decompiler为jad.exe的全路径,如笔者的:D:\program files\Java\jre6\bin\jad.exe

myeclipse和eclipse安装Java反编译插件

如果存在中文反编译的问题则点击Window > Preferences > Java > JadClipse > Misc,将Convert Unicode strings into ANSI strings选项打勾。

至此插件安装成功,点击class文件即可查看源码,如图查看mongodb的源码

myeclipse和eclipse安装Java反编译插件

对于myeclipse安装

MyEclipse自从7.0后就不再提供link安装,而是采用在bundles.info文件写入配置信息的方式安装插件。具体步骤如下:

1.下载你需要的安装的插件,其结构需要与link安装时候一致:

+yourPluginName (你的插件文件名--父)

+----plugins  (默认需要的文件夹--子)

+----features  (默认需要的文件夹--子)

eg.我的文件结构为

+jadplugin

+ ------features

+-------plugins

2.将插件文件夹复制到自定义插件文件夹(就是你自己便于管理,自建的文件夹,D:\program files\Genuitec\Common\jadplugin\plugins下)

3.利用myeclipse新建一个java文件,代码如下:

myeclipse和eclipse安装Java反编译插件
import java.io.File;
import java.util.ArrayList;
import java.util.List; //MyEclipse 7.5 插件配置代码生成器
public class PluginUtil { public PluginUtil() {
} public void print(String path) {
List<String> list = getFileList(path);
if (list == null) {
return;
} int length = list.size();
for (int i = 0; i < length; i++) {
String result = "";
String thePath = getFormatPath(getString(list.get(i)));
File file = new File(thePath);
if (file.isDirectory()) {
String fileName = file.getName();
if (fileName.indexOf("_") < 0) {
print(thePath);
continue;
}
String[] filenames = fileName.split("_");
String filename1 = filenames[0];
String filename2 = filenames[1];
result = filename1 + "," + filename2 + ",file:/" + path + "//"
+ fileName + "//,4,false";
System.out.println(result);
} else if (file.isFile()) {
String fileName = file.getName();
if (fileName.indexOf("_") < 0) {
continue;
}
int last = fileName.lastIndexOf("_");// 最后一个下划线的位置
String filename1 = fileName.substring(0, last);
String filename2 = fileName.substring(last + 1, fileName
.length() - 4);
result = filename1 + "," + filename2 + ",file:/" + path + "//"
+ fileName + ",4,false";
System.out.println(result);
} }
} public List<String> getFileList(String path) {
path = getFormatPath(path);
path = path + "/";
File filePath = new File(path);
if (!filePath.isDirectory()) {
return null;
}
String[] filelist = filePath.list();
List<String> filelistFilter = new ArrayList<String>(); for (int i = 0; i < filelist.length; i++) {
String tempfilename = getFormatPath(path + filelist[i]);
filelistFilter.add(tempfilename);
}
return filelistFilter;
} public String getString(Object object) {
if (object == null) {
return "";
}
return String.valueOf(object);
} public String getFormatPath(String path) {
path = path.replaceAll("////", "/");
path = path.replaceAll("//", "/");
return path;
} public static void main(String[] args) {
/* 你的插件的安装目录.参数String plugin 内容即为你所要安装插件的绝对路径。安装时只需要换成自己的插件路径即可 */
String plugin = "D:/Program Files//Genuitec/Common/jadplugin";
new PluginUtil().print(plugin);
}
}
myeclipse和eclipse安装Java反编译插件

4.运行上述代码,

5.将控制台输出的内容全部复制到D:/Program Files/Genuitec/MyEclipse 7.5/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info文件中。
5.重启myeclipse完成安装。

后面的配置和eclipse安装中的一致.

myeclipse和eclipse安装Java反编译插件

热爱生活,热爱Coding,敢于挑战,用于探索 ...
分类: Javaee
标签: 插件
绿色通道: 好文要顶 关注我 收藏该文与我联系 myeclipse和eclipse安装Java反编译插件
(请您对文章做出评价)