`
rentianchou
  • 浏览: 68505 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

myeclipse8.0以上版本安装插件

阅读更多
看到myeclipe8.5发布以后,很想体验下一下,因为我被7.5的版本速度实在是无语,动不动还整崩溃了。
初步安装是在公司的台式机上,运行起来蛮快的。安装插件只需要把你所需要的插件放到dropins目录下,然后重启myeclipe,它自己就自动安装了(启动的时可能会报错,不过插件可以使用)。
回到家之后想和公司配置一下相同的开发环境,于是又在自己的本本上重装了一遍,可是当把插件按照在公司装的程序重复了一遍,竟然无效。我开始怀疑莫非是版本的问题,于是又重新下载了myeclipse8.5M1、myeclipse8.5M2,重装了N遍,始终无法安装插件。彻底无语。。。
昨天晚上无意间搜到关于一篇用代码安装myeclipse的文章,测试了下果然很好用,代码如下:
myeclipse自从7.0后就不再提供link安装,而是采用在bundles.info文件写入配置信息的方式安装插件。具体步骤如下:1.下载你需要的安装的插件,其结构需要与link安装时候一致:
+yourPluginName
—-plugins
—-features
2.将插件文件夹复制到自定义插件文件夹(就是你自己便于管理,自建的文件夹,本文是在%MYELIPSE_HOME%myplugin)
3.利用myeclipse新建一个java文件,代码如下:
01package com.jsjol.blog
02
03import java.io.File;
04import java.util.ArrayList;
05import java.util.List;
06
07/**
08* MyEclipse 8.0 (2009-11-16) 插件配置代码生成器
09* http://blog.jsjol.com
10*/
11
12public class PluginConfigCreator {
13
14 public PluginConfigCreator() {}
15
16 public void print(String path) {
17 List < String > list = getFileList(path);
18 if (list == null) {
19 return;
20 }
21
22 int length = list.size();
23 for (int i = 0; i < length; i++) {
24 String result = "";
25 String thePath = getFormatPath(getString(list.get(i)));
26 File file = new File(thePath);
27 if (file.isDirectory()) {
28 String fileName = file.getName();
29 if (fileName.indexOf("_") < 0) {
30 print(thePath);
31 continue;
32 }
33 String[] filenames = fileName.split("_");
34 String filename1 = filenames[0];
35 String filename2 = filenames[1];
36 result = filename1 + "," + filename2 + ",file:/" + path + "\\" + fileName + "\\,4,false";
37 System.out.println(result);
38 } else if (file.isFile()) {
39 String fileName = file.getName();
40 if (fileName.indexOf("_") < 0) {
41 continue;
42 }
43 int last = fileName.lastIndexOf("_"); // 最后一个下划线的位置
44 String filename1 = fileName.substring(0, last);
45 String filename2 = fileName.substring(last + 1, fileName.length() - 4);
46 result = filename1 + "," + filename2 + ",file:/" + path + "\\" + fileName + ",4,false";
47 System.out.println(result);
48 }
49
50 }
51 }
52
53 public List < String > getFileList(String path) {
54 path = getFormatPath(path);
55 path = path + "/";
56 File filePath = new File(path);
57 if (!filePath.isDirectory()) {
58 return null;
59 }
60 String[] filelist = filePath.list();
61 List < String > filelistFilter = new ArrayList < String > ();
62
63 for (int i = 0; i < filelist.length; i++) {
64 String tempfilename = getFormatPath(path + filelist);
65 filelistFilter.add(tempfilename);
66 }
67 return filelistFilter;
68 }
69
70 public String getString(Object object) {
71 if (object == null) {
72 return "";
73 }
74 return String.valueOf(object);
75 }
76
77 public String getFormatPath(String path) {
78 path = path.replaceAll("\\\\", "/");
79 path = path.replaceAll("//", "/");
80 return path;
81 }
82
83 public static void main(String[] args) {
84 /*你的插件的安装目录*/
85 String plugin = "E:\\MyEclipse8\\myplugin\\aptana1.2";
86 new PluginConfigCreator().print(plugin);
87 }
88}
注意main函数中,参数String plugin 内容即为你所要安装插件的绝对路径。安装时只需要换成自己的插件路径即可。
4.运行上述代码,将控制台输出的内容全部复制到%MYECLIPSE_HOME%\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info文件中。
5.重启myeclipse完成安装
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics