myeclipse10.0優化,其它版本也適用

我用的是myeclipse10.0做的優化,早起版本8.5、8.6也都大同小異


一、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-->Jboss4.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和Jboss4,其他的不動 )

十一、加大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插件

(推薦一款自己寫的插件安裝工具:http://download.csdn.net/detail/sbfivwsll/4046311

說到插件,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. }  
import java.io.File;     
import java.util.ArrayList;     
import java.util.List;     
/**   
 * MyEclipse9 插件配置代碼生成器
 */    
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 = "F:\\MyEclipse10.0\\myEclipsePlugin\\svn";     
        new PluginConfigCreator().print(plugin);     
    }     
}
 6.把以上生成的字符串(一大堆)添加到第四步bundles.info文件的後面,然後重啓myeclipse即可。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章