<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Asktalk

    天行健,君子以自強不息!
    posts - 21, comments - 79, trackbacks - 0, articles - 2
      BlogJava :: 首頁 ::  :: 聯系 :: 聚合  :: 管理

    Eclipse啟動機制(1)

    Posted on 2007-12-22 16:33 Asktalk 閱讀(4905) 評論(3)  編輯  收藏 所屬分類: Eclipse/Swt/Jface
     

    最近我一直在研究Eclipse的架構體系,下面我們就來看看Eclipse的啟動機制吧

    1、Eclipse源代碼       
    eclipse-sourceBuild-srcIncluded-3.3.1.1.zip   
    版本:3.3.1.1        大小:95.058MB
    下載地址:http://download.eclipse.org/eclipse/downloads

    解壓后的目錄結構如下圖,通過執行build.bat可以編譯出完整的Eclipse-sdk-3.3.1.1運行包,和我們網上下載的一樣。但是這個過程可能需要一個小時左右的時間,要有耐性哦。所有的插件工程目錄在plugins中,我們只需要導入現有工程即可把plugins下所有工程導入。

    下面我們就先來研究一下Eclipse最核心的部分,就是RCP部分必須的插件。下面我列出了Eclipse RCP需要的插件。

    將這些代碼解壓縮到一個空目錄里,然后導入到Source InsightProject里。     

    二、Eclipse啟動過程

    首先我們從Eclipse的啟動過程開始分析。

    1exe部分的引導

    eclipse.exeEclipse的啟動文件,是與平臺相關的可執行文件。它的功能比較簡單,主要是加載startup.jar文件,代碼在Eclipse源代碼的eclipse-sourceBuild-srcIncluded-3.3.1.1"plugins"org.eclipse.platform"launchersrc.zip,對應多個平臺。對于win32平臺,你可以直接運行win32目錄下的build.bat文件來編譯得到它(需要安裝C編譯器)。

    2、java代碼部分的執行入口

    對于Eclipse 3.3.1.1版本來說,如果在eclipse目錄下沒有找到startup.jar,則直接執行org.eclipse.equinox.launcher.Main.main方法。

    當然我們可以在eclipse目錄下定制我們自己的啟動引導包startup.jar,現在Eclipse 3.3.1.1好像已經不建議這樣做了。如果有這個包,那么這個包將是java代碼的執行入口,你可以在命令行下運行java -jar startup.jar命令來啟動Eclipse。它的入口是org.eclipse.core.launcher.Main類,這個類最終執行的還是org.eclipse.equinox.launcher.Main.main方法。它對應的源代碼在org.eclipse.equinox.launcher目錄下的Main.java。關于此文件的定制詳細信息請查看eclipse-sourceBuild-srcIncluded-3.3.1.1"plugins"org.eclipse.platform"launchersrc.zip中的eclipse.c的注解部分。

    我們從main函數往后跟蹤,找到basicRun方法,這個是啟動的主要部分。

        protectedvoid basicRun(String[] args) throws Exception {

            System.getProperties().put("eclipse.startTime", Long.toString(System.currentTimeMillis())); //$NON-NLS-1$

            commands = args;

            String[] passThruArgs = processCommandLine(args);

           

            if (!debug)

               // debug can be specified as system property as well

               debug = System.getProperty(PROP_DEBUG) != null;

            setupVMProperties();     //設置VM屬性

            processConfiguration();   //讀取configuration/config.ini配置文件

           

            // need to ensure that getInstallLocation is called at least once to initialize the value.

            // Do this AFTER processing the configuration to allow the configuration to set

            // the install location. 

            getInstallLocation();

            // locate boot plugin (may return -dev mode variations)

            URL[] bootPath = getBootPath(bootLocation);

            

            //Set up the JNI bridge. We need to know the install location to find the shared library

            setupJNI(bootPath);

           

            //ensure minimum Java version, do this after JNI is set up so that we can write an error message

            //with exitdata if we fail.

            if (!checkVersion(System.getProperty("java.version"), System.getProperty(PROP_REQUIRED_JAVA_VERSION))) //$NON-NLS-1$

                return;

           

            setSecurityPolicy(bootPath); //設置執行權限

            // splash handling is done here, because the default case needs to know

            // the location of the boot plugin we are going to use

            handleSplash(bootPath);

            beforeFwkInvocation();

            invokeFramework(passThruArgs, bootPath);    //啟動Eclipse內核

        }


    評論

    # re: Eclipse啟動機制(1)[未登錄]  回復  更多評論   

    2007-12-25 14:09 by washington
    好東西,收藏了。謝謝。

    # re: Eclipse啟動機制(1)  回復  更多評論   

    2008-01-30 10:52 by wzl
    不錯,學到一些東西

    # re: Eclipse啟動機制(1)  回復  更多評論   

    2008-02-23 09:38 by Java.net
    那么多項目,你是怎么導進eclipse的?一個一個導?
    主站蜘蛛池模板: 日韩精品视频免费在线观看| 亚洲电影在线免费观看| 国产性生交xxxxx免费| 亚洲日韩乱码中文字幕| 免费观看黄网站在线播放| 亚洲一区二区三区免费在线观看| 1000部免费啪啪十八未年禁止观看 | 在线观看H网址免费入口| 亚洲视频手机在线| 国产成人yy免费视频| 亚洲中文字幕久久精品无码2021| 中文毛片无遮挡高潮免费| 456亚洲人成在线播放网站| 国产美女在线精品免费观看| 亚洲精品精华液一区二区| 国产成人高清精品免费鸭子| 免费看一级毛片在线观看精品视频| 亚洲第一页日韩专区| 国产猛男猛女超爽免费视频| 亚洲四虎永久在线播放| 我们的2018在线观看免费高清| 亚洲日韩国产二区无码 | www成人免费视频| 亚洲成AV人片在线观看无码| 午夜免费1000部| 色婷婷六月亚洲综合香蕉| 在线观看国产区亚洲一区成人| 午夜免费福利视频| 亚洲一线产品二线产品| 免费中文字幕在线观看| 免费无码一区二区三区蜜桃| 亚洲欧洲久久精品| 亚洲XX00视频| 蜜桃成人无码区免费视频网站 | 日韩欧美一区二区三区免费观看| 亚色九九九全国免费视频| 亚洲AV无码成人网站久久精品大| 一级毛片免费不卡在线| 亚洲日韩看片无码电影| 亚洲视频人成在线播放| 99热这里只有精品免费播放|