| 1 | {{{ |
| 2 | #!html |
| 3 | <div style="text-align: center; color:#151B8D"><big style="font-weight: bold;"><big><big> |
| 4 | 編譯 hadoop 0.20.1 的 eclipse plugin |
| 5 | </big></big></big></div> <div style="text-align: center; color:#7E2217"><big style="font-weight: bold;"><big> |
| 6 | Eclipse 3.3 3.4 3.5 適用 |
| 7 | </big></big></div> |
| 8 | }}} |
| 9 | [[PageOutline]] |
| 10 | |
| 11 | = 前言 = |
| 12 | |
| 13 | * 從 hadoop 0.20.1 之後,contrib 資料夾下就在也找不到 eclipse-plugin 可以用了,因為作者群認為大家不是小孩子了,要自己種出東西來吃,而不是伸手要來之後又一直抱怨有瑕疵...(在這之前一直抱怨有瑕疵的就是我)。 |
| 14 | |
| 15 | * 此篇可以幫助大家編譯出適用於 hadoop 0.20 的 各版本 eclipse plugin (hadoop-0.20.1-eclipse-plugin.jar)出來 |
| 16 | |
| 17 | * 參考 http://wiki.apache.org/hadoop/EclipsePlugIn |
| 18 | |
| 19 | = 安裝 = |
| 20 | |
| 21 | * 安裝 hadoop-0.20.1 於 /nfs/opt 目錄下 |
| 22 | * 安裝 eclipse 各版本套件於 /nfs/opt 目錄底下 |
| 23 | |
| 24 | = 設定 Eclipse = |
| 25 | 編譯的過程中 |
| 26 | |
| 27 | == Eclipse 3.3 == |
| 28 | 為預設值免設定此步驟 |
| 29 | |
| 30 | == Eclipse 3.4 == |
| 31 | |
| 32 | * 需要改 /nfs/opt/hadoop-0.20.1/src/contrib/build-contrib.xml |
| 33 | {{{ |
| 34 | #!text |
| 35 | <property name="eclipse.home" location="/nfs/opt/eclipse34/"/> |
| 36 | }}} |
| 37 | |
| 38 | * 修改 /nfs/opt/hadoop-0.20.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/launch/HadoopApplicationLaunchShortcut.java |
| 39 | {{{ |
| 40 | #!java |
| 41 | import org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut; |
| 42 | //import org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut; |
| 43 | }}} |
| 44 | |
| 45 | == Eclipse 3.5 == |
| 46 | |
| 47 | * 需要改/nfs/opt/hadoop-0.20.1/src/contrib/build-contrib.xml |
| 48 | {{{ |
| 49 | #!text |
| 50 | <property name="eclipse.home" location="/nfs/opt/eclipse35/"/> |
| 51 | }}} |
| 52 | |
| 53 | * 修改 /nfs/opt/hadoop-0.20.1/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/launch/HadoopApplicationLaunchShortcut.java |
| 54 | {{{ |
| 55 | import org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut; |
| 56 | //import org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationLaunchShortcut; |
| 57 | }}} |
| 58 | |
| 59 | = 編譯與封裝 = |
| 60 | |
| 61 | {{{ |
| 62 | $ cd /nfs/opt/hadoop-0.20.1/ |
| 63 | $ ant compile |
| 64 | $ ln -sf /nfs/opt/hadoop-0.20.1/docs /nfs/opt/hadoop-0.20.1/build/docs |
| 65 | $ ant package |
| 66 | }}} |
| 67 | |
| 68 | 如果沒有出錯的話,檔案出現在 /nfs/opt/hadoop-0.20.1/build/contrib/eclipse-plugin/hadoop-0.20.2-dev-eclipse-plugin.jar |
| 69 | |
| 70 | 將這個檔案(看要不要改名成 hadoop-0.20.1-eclipse-plugin.jar 皆可)放到你的 /nfs/opt/eclipse/plugin 內就可以囉! |