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


    为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 filesJavajre6in下

    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 fileseclipseplugins
    myeclipse拷贝到Commonplugins目录下,如笔者:D:program filesGenuitecCommonplugins

    对于eclipse安装

    如下: Windows —>  Perference —> Java下面应该会多出一个JadClipse目录,,相关的设置可以在此修改配置jadclipse:

    设置path to decompiler为jad.exe的全路径,如笔者的:D:program filesJavajre6injad.exe

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

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

    对于myeclipse安装

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

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

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

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

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

    eg.我的文件结构为

          +jadplugin

               + ------features

               +-------plugins

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

    3.利用myeclipse新建一个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);
        }
    }
    复制代码

    4.运行上述代码,

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

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

    在线交谈

    热爱生活,热爱Coding,敢于挑战,用于探索 ...
     
    分类: Javaee
    标签: 插件
    绿色通道: 好文要顶 关注我 收藏该文与我联系 
    0
    0
     
    (请您对文章做出评价)
     
    « 上一篇:使用Lucene检索文档中的关键字
    » 下一篇:Java生成中文验证码
  • 相关阅读:
    k8s配置 storageclass 本地 NFS debian环境
    [转载] jenkins 设置 查看 环境变量
    debian 安装 nfs server和 客户端
    创建Vue程序
    准备开发环境
    一道易错的SQL面试题
    创建项目、类、对象并添加一个属性(行为、存储状态)
    SQL大神之(1)数据库的死锁模拟
    Python 魔术方法指南
    SQL的concat()replace()和mid()函数的使用
  • 原文地址:https://www.cnblogs.com/fx2008/p/4164564.html
Copyright © 2020-2023  润新知