英文版的Eclipse看着很不舒服,我们可以用以下方法对其进行汉化
1.下载language包,下载地址:http://202.199.155.5:1127/uploadfile/language.rar(打开IE浏览器,将此地址复制到地址栏即可)
下载完成后将其解压到你的MyEclipse的安装目录下。默认安装地址为
C:/Program Files/Genuitec/MyEclipse 7.5
如本人的安装地址为:
D:/Program Files/Genuitec/MyEclipse 7.5/
2.建立新的java工程,建立一个CreatePluginsConfig类
3.在这个java文件中输入以下内容:
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class CreatePluginsConfig {
public CreatePluginsConfig() {
}
public void print(String path) {
List 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 getFileList(String path) {
path = getFormatPath(path);
path = path + "/";
File filePath = new File(path);
if (!filePath.isDirectory()) {
return null;
}
String[] filelist = filePath.list();
List filelistFilter = new ArrayList();
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 = "d://Program Files//Genuitec//MyEclipse 7.5//language//plugins";
new CreatePluginsConfig().print(plugin);
}
}
注意:上面的红色部分为你的MyEclipse安装地址。请依据个人安装地址填写
4.运行以上程序得到:
com.lowagie.itext.nl_zh,3.4.0.v20090215043402,file:/d:/Program Files/Genuitec/MyEclipse 7.5/language/plugins/com.lowagie.itext.nl_zh_3.4.0.v20090215043402.jar,4,false
net.sf.jadclipse,3.3.0,file:/d:/Program Files/Genuitec/MyEclipse 7.5/language/plugins/net.sf.jadclipse_3.3.0.jar,4,false
org.apache.cactus.nl_zh,3.4.0.v20090215043402,file:/d:/Program Files/Genuitec/MyEclipse 7.5/language/plugins/org.apache.cactus.nl_zh_3.4.0.v20090215043402.jar,4,false
org.apache.derby.core.nl_zh,3.4.0.v20090215043402,file:/d:/Program Files/Genuitec/MyEclipse 7.5/language/plugins/org.apache.derby.core.nl_zh_3.4.0.v20090215043402.jar,4,false
注明:由于运行结果太长,我没有写全,只是列出了前几段运行结果。请不要直接复制这段代码,否则会出现编码问题,直接将自己运行后的代码复制即可,
5.打开MyEclipse的暗转目录中的 bundles.info 文件 (如本人地址为下:)
D:/Program Files/Genuitec/MyEclipse 7.5/configuration/org.eclipse.equinox.simpleconfigurator
用记事本打开bundles.info文件,在文件最后面添加上一步运行后的代码,并保存
6.打开Myeclipse安装目录,找到myeclipse.ini文件,用记事本打开,同样在最后加上-Duser.language=zh
并保存
7.关闭Myeclipse,重新打开,发现这次已经变为中文版了(如下)。呵呵 ,祝您成功。
8.ok,到此为止,我们已经完成了汉化工作