{{{ #!html
Hadoop Develop with Eclipse
}}} [[PageOutline]] = 目的 = 用eclipse編譯hadoop的src = 環境 = * sun-java6-jdk * eclipse europa * 工作目錄於 /home/waue/workspace * 步驟二之後的動作於eclipse 設定 = 1. 用svn 下載最新的hadoop branch = *(以0.18為例) {{{ $ svn co http://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.18/ }}} = 2 將hadoop專案用ecilpse打開 = {{{ #!text file -> new -> project -> java project => next project name: brance-0.18 create project from existing source : /home/waue/workspace/branch-0.18 => finish }}} [[Image(wiki:waue/2009/0904:2.png)]] ------------ = 3 設定專案屬性 = {{{ #!text 點選branch-0.18 右鍵 -> properties }}} = 3.1 properties -> builders = {{{ #!text * import -> build.xml * 取消 java builder 的 勾 * branch-0.18 build.xml 打勾 * edit }}} [[Image(wiki:waue/2009/0904:3.1.png)]] ------------ = 3.1.1 edit的細部設定 = * main (設定 buildfile路徑) [[Image(wiki:waue/2009/0904:3.1.1-1.png)]] ------------ * classpath [[Image(wiki:waue/2009/0904:3.1.1-2.png)]] ------------ * target (設定build時的方法,注意要點 '''set targets ...'''才能設定) [[Image(wiki:waue/2009/0904:3.1.1-3.png)]] ------------ * 點 '''set targets ...''' 的設定畫面 (注意 order 的順序很重要,先compiler, 再 package) [[Image(wiki:waue/2009/0904:3.1.1-3-1.png)]] ------------ = 3.2 properties -> java build path = {{{ #!text * source -> default output folder : branch-0.18/build }}} [[Image(wiki:waue/2009/0904:3.2.png)]] ------------ = 3.3 properties -> java compiler = {{{ #!text compiler level : 6.0 }}} [[Image(wiki:waue/2009/0904:3.3.png)]] ------------ = 4 執行 = * run {{{ #!text build.xml -> run as -> ant build }}} [[Image(wiki:waue/2009/0904:4-1.png)]] ------------ * run 完的畫面 [[Image(wiki:waue/2009/0904:4-2.png)]] ------------ * 可在 專案的build資料夾內看到編譯後的jar檔 [[Image(wiki:waue/2009/0904:4-3.png)]] ------------