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

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

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

    Asktalk

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

    Eclipse啟動(dòng)機(jī)制(1)

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

    最近我一直在研究Eclipse的架構(gòu)體系,下面我們就來看看Eclipse的啟動(dòng)機(jī)制吧

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

    解壓后的目錄結(jié)構(gòu)如下圖,通過執(zhí)行build.bat可以編譯出完整的Eclipse-sdk-3.3.1.1運(yùn)行包,和我們網(wǎng)上下載的一樣。但是這個(gè)過程可能需要一個(gè)小時(shí)左右的時(shí)間,要有耐性哦。所有的插件工程目錄在plugins中,我們只需要導(dǎo)入現(xiàn)有工程即可把plugins下所有工程導(dǎo)入。

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

    將這些代碼解壓縮到一個(gè)空目錄里,然后導(dǎo)入到Source InsightProject里。     

    二、Eclipse啟動(dòng)過程

    首先我們從Eclipse的啟動(dòng)過程開始分析。

    1exe部分的引導(dǎo)

    eclipse.exeEclipse的啟動(dòng)文件,是與平臺(tái)相關(guān)的可執(zhí)行文件。它的功能比較簡(jiǎn)單,主要是加載startup.jar文件,代碼在Eclipse源代碼的eclipse-sourceBuild-srcIncluded-3.3.1.1"plugins"org.eclipse.platform"launchersrc.zip,對(duì)應(yīng)多個(gè)平臺(tái)。對(duì)于win32平臺(tái),你可以直接運(yùn)行win32目錄下的build.bat文件來編譯得到它(需要安裝C編譯器)。

    2java代碼部分的執(zhí)行入口

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

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

    我們從main函數(shù)往后跟蹤,找到basicRun方法,這個(gè)是啟動(dòng)的主要部分。

        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();     //設(shè)置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); //設(shè)置執(zhí)行權(quán)限

            // 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);    //啟動(dòng)Eclipse內(nèi)核

        }


    評(píng)論

    # re: Eclipse啟動(dòng)機(jī)制(1)[未登錄]  回復(fù)  更多評(píng)論   

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

    # re: Eclipse啟動(dòng)機(jī)制(1)  回復(fù)  更多評(píng)論   

    2008-01-30 10:52 by wzl
    不錯(cuò),學(xué)到一些東西

    # re: Eclipse啟動(dòng)機(jī)制(1)  回復(fù)  更多評(píng)論   

    2008-02-23 09:38 by Java.net
    那么多項(xiàng)目,你是怎么導(dǎo)進(jìn)eclipse的?一個(gè)一個(gè)導(dǎo)?
    主站蜘蛛池模板: 67pao强力打造国产免费| 在线看片无码永久免费aⅴ| 亚洲精品国产肉丝袜久久| 亚洲大尺度无码无码专区| 亚洲一级毛片免费观看| 国产天堂亚洲精品| 亚洲精品狼友在线播放| 亚洲免费综合色在线视频| 亚洲一区二区三区免费| 亚洲欧洲精品久久| 亚洲成a人片在线观看日本麻豆| 外国成人网在线观看免费视频| 亚洲欧美日韩自偷自拍| 7723日本高清完整版免费| 特级毛片A级毛片免费播放| 亚洲日韩区在线电影| 免费va人成视频网站全| 永久在线免费观看| 国产三级在线免费观看| 在线a亚洲老鸭窝天堂av高清| 久久久久亚洲精品无码网址| 免费看韩国黄a片在线观看| 中文在线日本免费永久18近| 亚洲色成人网站WWW永久四虎 | 亚洲免费一级视频| 亚美影视免费在线观看| 亚洲妇女熟BBW| 亚洲国产精品久久久久久| 国产免费人成视频在线观看| 114级毛片免费观看| 成人免费av一区二区三区| 国产精品亚洲一区二区在线观看| 亚洲网红精品大秀在线观看| 国产福利电影一区二区三区,亚洲国模精品一区 | 国产一二三四区乱码免费| 亚洲小说图区综合在线| 日本久久久久亚洲中字幕| 亚洲一区无码中文字幕| 全部免费毛片在线播放| 一级特级aaaa毛片免费观看| 亚洲第一成年网站视频 |