当前位置: 代码迷 >> Eclipse >> myeclipse 十 优化
  详细解决方案

myeclipse 十 优化

热度:583   发布时间:2016-04-23 12:52:08.0
myeclipse 10 优化

一、Myeclipse10修改字体
MyEclipse10是基于Eclipse3.7内核,但在Eclipse的Preferences-〉general-〉 Appearance->Colors and Fonts 中并没有找到Courier New字体,它采用的是Consolas字体,中文看着非常小非常别扭,在Windows7下,系统自带虽然有Courier New字体,但是并没有激活显示,需要手动激活,才能在软件中使用
激活方法如下:
在win7的控制面板->字体,找到Courier New,右键,显示。 Courier 常规 ,右键,显示。
window-->preferences-->搜索font-->Color and Font-->Basic-->Text Font-->Edit--> Courier New-->常规-->四号

二、myeclipse修改jsp、xml默认打开方式
window-->preferences-->General-->Editors-->File Associations-->选择File Type-->
Associated editors选择默认的打开方式(Default)

三、Myeclipse修改编译兼容级别_Compiler compliance Level
Window-->Preferences-->Java-->Compiler --> Compiler compliance Level-->1.6

四、修改Myeclipse编码方式:text+jsp
1. window-->preferences-->搜索JSP-->Myeclipse-->Files and Editors-->JSP-->encoding-->UTF-8
2. window-->preferences-->General-->Workspace-->Text file encoding-->Other-->UTF-8

五、myeclipse修改Jboss内存大小
myeclipse菜单栏:Preferences-->搜索Jboss-->Jboss7.X下-->JDK--Optional java VM arguments加入如下代码:
-Xms512m -Xmx1024m -XX:MaxNewSize=256m -XX:MaxPermSize=256m


?

?

六、老是弹出Quick update error 、关闭myeclipse的Quick Update自动更新功能
这个问题的解决办法是关闭自动更新
Windows > Preferences > MyEclipse Enterprise Workbench > Community Essentials,
把选项 "Search for new features on startup"的前勾去掉即可。


七 、关闭updating indexes
Window > Preferences > Myeclipse Enterprise Workbench > Maven4Myeclipse > Maven>
禁用Download repository index updates on startup 。
注意:强调一个问题,很多人发现无法找到这个,原因其实是它已经关闭了。

八 、关闭MyEclipse的自动validation
validation有一堆,什么xml、jsp、jsf、js等等,我们没有必要全部都去自动校验一下,
只是需要的时候才会手工校验一 下,速度立马提升好几个档次

8.1取消MyEclipse在启动时自动验证项目配置文件
默认情况下MyEclipse在启动的时候会自动验证每个项目的配置文件,这是一个非常耗时的过程,可以在Preferences窗口依次选择 MyEclipse - Validation,然后在右侧的Validator列表中只保留 Manual 项就可以了。如果需要验证的时候只需要选中文件,然后右键选择 MyEclipse - Run Validation就可以了。
windows–>perferences–>myeclipse–>validation
把 除了manual 下面的全部点掉,build下只留 classpath dependency Validator

8.2手工验证方法:
在要验证的文件上,单击鼠标右键–>myeclipse–>run validation

九 、关闭拼写检查
拼写检查会给我们带来不少的麻烦,我们的方法命名都会是单词的缩写,他也会提示有错,所以最好去掉,没有多大的用处:
windows–>perferences–>general–>validation->editors->Text Editors->spelling
-->Enable spell checking

十、 启动优化,关闭不需要使用的模块
一个系统20%的功能往往能够满足80%的需求,MyEclipse也不例外,我们在大多数时候只需要20%的系统功能,
所以可以将一些不使用的模块禁止 加载启动。
Window > Preferences > General > Startup andy Shutdown 在这里列出的是MyEclipse启动时加载的模块
我这里只让它加载tomcat5 勾选 MyEclipse EASIE Tomcat 5 。
怎样才能知道哪些启动项有用呢?我现在把我知道的启动项用处说一下,还有很多不懂的,
希望大家懂的回复在下面 啊:
WTP :一个跟myeclipse差不多的东西,主要差别是 WTP 是免费的,如果使用myeclipse,这个可以取消
Mylyn:组队任务管理工具,类似于 CVS ,以任务为单位管理项目进度,没用到的可以取消
Derby:一种保存成 jar 形式的数据库,我没用到,取消
一大排以 MyEclipse EASIE 打头的启动项:myeclipse 支持的服务器,只选自己用的,其他取消,
比如我只选了 tomcat 。
(个人配置: MyEclipse EASIE只保留tomcat6和Jboss7,其他的不动 )

十一、加大JVM的非堆内存

打开 myeclipse.ini
-startup
../Common\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar
--launcher.library
../Common\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731
-clean
-configuration
configuration
-vm
C:\Users\lenovo\AppData\Local\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\jre\bin\client\jvm.dll
-vmargs
-Xmx384m
-XX:MaxPermSize=384m
-XX:ReservedCodeCacheSize=96m

以上是我的myeclipse.ini,需要修改是 -Xmx,-XX:MaxPermSize,-XX:ReservedCodeCacheSize,
将这三项的值调大,但并不是越大越好,曾经在相同的条件下做过测试(内存2GB),-Xmx,-XX:MaxPermSize的值为384m时比512m时要快(视具体的计算机而定),
-Xmx,-XX:MaxPermSize 的值设为同样大小且两者之和不能超出你的计算机本身的内存大小


十二、myeclipse10加入svn插件

说到插件,myeclipse自8.X开始,插件安装就变得巨难用,通常最好还是用离线安装,在线安装很可能出问题,下面仅以SVN安装为例,其他诸如ADT15,Aptana等都可采用

1.首先下载SVN包:svn-1.6
2.解压SVN包,然后找到其中的两个文件夹:features 和 plugins
3.随意建一个文件夹(位置和名称自己定就好了,我的是E:\myEclipsePlugin\svn),然后把第二步的解压好的features 和 plugins放到这个文件夹下
4.找到myeclipse的安装目录,下面有一个configuration\org.eclipse.equinox.simpleconfigurator\bundles.info 文件。现在需要做的就是在该文件内添加的东西
5.添加的内容用下面的类生成:

Java代码 收藏代码
  1. import java.io.File;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. /**
  5. * MyEclipse9 插件配置代码生成器
  6. */
  7. public class PluginConfigCreator
  8. {
  9. public PluginConfigCreator()
  10. {
  11. }
  12. public void print(String path)
  13. {
  14. List<String> list = getFileList(path);
  15. if (list == null)
  16. {
  17. return;
  18. }
  19. int length = list.size();
  20. for (int i = 0; i < length; i++)
  21. {
  22. String result = "";
  23. String thePath = getFormatPath(getString(list.get(i)));
  24. File file = new File(thePath);
  25. if (file.isDirectory())
  26. {
  27. String fileName = file.getName();
  28. if (fileName.indexOf("_") < 0)
  29. {
  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 + "/"
  37. + fileName + "\\,4,false";
  38. System.out.println(result);
  39. } else if (file.isFile())
  40. {
  41. String fileName = file.getName();
  42. if (fileName.indexOf("_") < 0)
  43. {
  44. continue;
  45. }
  46. int last = fileName.lastIndexOf("_");// 最后一个下划线的位置
  47. String filename1 = fileName.substring(0, last);
  48. String filename2 = fileName.substring(last + 1, fileName
  49. .length() - 4);
  50. result = filename1 + "," + filename2 + ",file:/" + path + "/"
  51. + fileName + ",4,false";
  52. System.out.println(result);
  53. }
  54. }
  55. }
  56. public List<String> getFileList(String path)
  57. {
  58. path = getFormatPath(path);
  59. path = path + "/";
  60. File filePath = new File(path);
  61. if (!filePath.isDirectory())
  62. {
  63. return null;
  64. }
  65. String[] filelist = filePath.list();
  66. List<String> filelistFilter = new ArrayList<String>();
  67. for (int i = 0; i < filelist.length; i++)
  68. {
  69. String tempfilename = getFormatPath(path + filelist[i]);
  70. filelistFilter.add(tempfilename);
  71. }
  72. return filelistFilter;
  73. }
  74. public String getString(Object object)
  75. {
  76. if (object == null)
  77. {
  78. return "";
  79. }
  80. return String.valueOf(object);
  81. }
  82. public String getFormatPath(String path)
  83. {
  84. path = path.replaceAll("\\\\", "/");
  85. path = path.replaceAll("//", "/");
  86. return path;
  87. }
  88. public static void main(String[] args)
  89. {
  90. /*你的SVN的features 和 plugins复制后放的目录*/
  91. String plugin = "F:\\MyEclipse10.0\\myEclipsePlugin\\svn";
  92. new PluginConfigCreator().print(plugin);
  93. }
  94. }

6.把以上生成的字符串(一大堆)添加到第四步bundles.info文件的后面,然后重启myeclipse即可。

  相关解决方案