由于本人公司电脑硬件比较老旧,就在前几天系统突然出现各种错误,在网上搜索各种解决办法都没能拯救该系统的情况,只能无奈重装系统了(Myeclipse8.5我不是安装在系统盘里的),打开Myeclipse8.5,编辑js代码的时候,只要js代码超过200行,Myeclipse8.5必然会出现无响应,让我非常恼火。说道这里,有些同行可能会笑话我了,你这啥破电脑,编辑下js代码Myeclipse都能卡死。其实我也很想换电脑,可惜公司不给换(其实也是我们部门的领导没能力)。我的这台电脑,奔腾E5700的CPU,4GB的内存,不过我后边的同事的电脑还是2GB的内存,我经常看到他在那等着Myeclipse编译完成。看到这里,我欣慰多了。我发誓以后换地方上班了,先看电脑配置,电脑配置差的不去(开玩笑的,还得看钱)。
哎,回到正题吧,既然没法使用配置好些的电脑,那只能通过别的方式来解决Myeclipse编辑js代码经常无响应的问题了。当然,我知道有个叫啥Spket工具,编辑js很不错的。首先,在Spket官网http://www.spket.com/download.html下载spket插件,当前最新的版本是1.6.23,点击页面的"Plugin"即可下载。下载完成后解压,如图所示
然后将“features”跟“plugins”复制,放在电脑磁盘的目录下,我本人是放在E盘的Program Files的site-1.10.6文件夹下。这里也许有人说,可以直接把“features”跟“plugins”文件夹里面的东西放在Myeclipse的目录下的dropins目录下,我只能说此法不通,还有人说我还可以采用links方式安装,从中解压出features与 plugins文件夹,复制到D:\MyEclipse\myPlugin\svn里面,其它的*.xml文件不要。
在 E:\MyEclipse\MyEclipse9.0\dropins下新建文件svn.link,内容是:path=E:\\MyEclipse \\myPlugin\\svn保存,然后重启Myeclipse。我试过,没有用。那么只好用最后一种方式了。将下面的
package com;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class PluginConfigCreator {
public PluginConfigCreator() {
}
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) {
/* 你的SVN插件的的features 和 plugins存放的目录 */
String plugin = "E:\\Program Files\\site-1.10.6";
new PluginConfigCreator().print(plugin);
}
}运行该代码,用记事本打开Myeclipse安装目录下的D:\Program Files (x86)\MyEclipse 8.5\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info,将控制台输出的内容复制,粘贴在bundlse.info的最下面,然后重启Myeclipse,Spket插件安装完毕。至于怎么在Myeclipse中配置下Spket,请自行百度吧。
以上部分内容参考自http://www.oschina.net/question/158170_34997
http://cruih.iteye.com/blog/898456等
本文出自 “java小菜” 博客,请务必保留此出处http://3440684.blog.51cto.com/3430684/1653080
重装系统之后Myeclipse8.5手动安装Spket插件无效问题的解决办法
原文地址:http://3440684.blog.51cto.com/3430684/1653080