myeclipse9.0安装svn(保证成功)

转至:http://www.minsoft.cn/skill/496.jhtml

为什么标题要写保证成功呢?因为我已经测试验证了,绝对好使!

原因是以前的方法(直接复制到plugin里,link安装)都不好用了,9.0不吃这一套,所以告诉大家这么做一定能够装上!!

此方法适用于所有版本的myeclipse9.0(M1或者官方下载版)

测试环境:

操作系统:Windows 7  X32

 JDK      : JDK1.6_17_X64

1、下载最新的SVN包(我下的是1.0.6版):

http://subclipse.tigris.org/servlets/ProjectDocumentList?folderID=2240

2、在你的磁盘上任意位置创建文件夹:“myplugins/svn”。名字可以任取,为了方便插件管理,建议名称为“myplugins”。

3、将解压的svn里的两个文件夹拷贝到“myplugins/svn”下。

4、复制下列java代码,修改路径并执行:

 点此下载 (我已经整理成JAVA文件件了,你不用复制下面代码了,ohoh~~)

01.package app;  
02. 
03.import java.io.File;  
04.import java.util.ArrayList;  
05.import java.util.List;  
06./** 
07. * MyEclipse9 插件配置代码生成器 
08. * 
09. * 
10. */ 
11.public class PluginConfigCreator  
12.{  
13.    public PluginConfigCreator()  
14.    {  
15.    }  
16.    public void print(String path)  
17.    {  
18.        List<String> list = getFileList(path);  
19.        if (list == null)  
20.        {  
21.            return;  
22.        }  
23.        int length = list.size();  
24.        for (int i = 0; i < length; i++)  
25.        {  
26.            String result = "";  
27.            String thePath = getFormatPath(getString(list.get(i)));  
28.            File file = new File(thePath);  
29.            if (file.isDirectory())  
30.            {  
31.                String fileName = file.getName();  
32.                if (fileName.indexOf("_") < 0)  
33.                {  
34.                    print(thePath);  
35.                    continue;  
36.                }  
37.                String[] filenames = fileName.split("_");  
38.                String filename1 = filenames[0];  
39.                String filename2 = filenames[1];  
40.                result = filename1 + "," + filename2 + ",file:/" + path + "/" 
41.                        + fileName + "\\,4,false";  
42.                System.out.println(result);  
43.            } else if (file.isFile())  
44.            {  
45.                String fileName = file.getName();  
46.                if (fileName.indexOf("_") < 0)  
47.                {  
48.                    continue;  
49.                }  
50.                int last = fileName.lastIndexOf("_");// 最后一个下划线的位置  
51.                String filename1 = fileName.substring(0, last);  
52.                String filename2 = fileName.substring(last + 1, fileName  
53.                        .length() - 4);  
54.                result = filename1 + "," + filename2 + ",file:/" + path + "/" 
55.                        + fileName + ",4,false";  
56.                System.out.println(result);  
57.            }  
58.        }  
59.    }  
60.    public List<String> getFileList(String path)  
61.    {  
62.        path = getFormatPath(path);  
63.        path = path + "/";  
64.        File filePath = new File(path);  
65.        if (!filePath.isDirectory())  
66.        {  
67.            return null;  
68.        }  
69.        String[] filelist = filePath.list();  
70.        List<String> filelistFilter = new ArrayList<String>();  
71.        for (int i = 0; i < filelist.length; i++)  
72.        {  
73.            String tempfilename = getFormatPath(path + filelist[i]);  
74.            filelistFilter.add(tempfilename);  
75.        }  
76.        return filelistFilter;  
77.    }  
78.    public String getString(Object object)  
79.    {  
80.        if (object == null)  
81.        {  
82.            return "";  
83.        }  
84.        return String.valueOf(object);  
85.    }  
86.    public String getFormatPath(String path)  
87.    {  
88.        path = path.replaceAll("\\\\", "/");  
89.        path = path.replaceAll("//", "/");  
90.        return path;  
91.    }  
92.    public static void main(String[] args)  
93.    {  
94.        /*你的插件的安装目录*/ 
95.            String plugin = "改成安装目录\\Genuitec\\svn";  
96.        new PluginConfigCreator().print(plugin);  
97.    }  
98.} 

这里需要注意的是修改成为刚才svn所在路径,建议改为绝对路径。比如我的svn在“/opt/soft/Genuitec/myplugins/svn/”,那么就这样:String plugin = "/opt/soft/Genuitec/myplugins/svn/";

用windows的朋友只需要设置你们的绝对路径就可以了,比如d:/myplugins/svn/。。。

5、找到“$myeclipse_home/configuration/org.eclipse.equinox.simpleconfigurator/”,打开其中的“bundles.inf”文件,为了防止分不清是不是我们自己后加的东西,在最后面多回几次车,然后粘贴第4步运行后的代码,保存

6、重启myeclipse , 我们的svn终于回来了!


你可能感兴趣的:(myeclipse9.0安装svn(保证成功))