close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": /usr/lib/python2.7/dist-packages/libsvn/_delta.so: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.
- Timestamp:
-
Aug 18, 2009, 11:23:29 AM (16 years ago)
- Author:
-
waue
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
|
v3
|
v4
|
|
| 8 | 8 | = 0. environment = |
| 9 | 9 | |
| 10 | | || || || || |
| | 10 | 編譯hadoop 需要額外安裝 ant, forrest ,而forrest 需要安裝 java-1.5 來編譯 |
| | 11 | |
| 11 | 12 | || hadoop 安裝於 ||/opt || hadoop_home = /opt/hadoop || |
| 12 | 13 | || forrest 目錄||/opt/forrest-0.8 || [http://ftp.twaren.net/Unix/Web/apache/forrest/apache-forrest-0.8.tar.gz 下載]|| |
| … |
… |
|
| 24 | 25 | |
| 25 | 26 | = 2. ant = |
| | 27 | |
| | 28 | * 程式碼在 /opt/hadoop/src 內 |
| | 29 | * 改完程式碼之後,執行ant 來產生相對應檔案 |
| | 30 | * ant 的編譯規則在 build.xml 可以讀此檔以了解到動作與其相依的訊息 |
| | 31 | * 設定屬性值 |
| | 32 | {{{ |
| | 33 | #!text |
| | 34 | <property name="Name" value="Hadoop-core"/> |
| | 35 | }}} |
| | 36 | * ant 的動作,如執行 '''ant docs '''會參考此動作敘述 |
| | 37 | {{{ |
| | 38 | #!xml |
| | 39 | <target name="docs" depends="forrest.check" description="檢查說明" if="forrest.home"> |
| | 40 | <exec dir="${docs.src}" executable="${forrest.home}/bin/forrest" failonerror="true"> |
| | 41 | <env key="JAVA_HOME" value="${java5.home}"/> |
| | 42 | </exec> |
| | 43 | <copy todir="${build.docs}"> |
| | 44 | <fileset dir="${docs.src}/build/site/" /> |
| | 45 | </copy> |
| | 46 | </target> |
| | 47 | }}} |
| | 48 | |
| | 49 | * 產生 Hadoop-Core-${version}.tar.gz |
| | 50 | {{{ |
| | 51 | $ ant tar |
| | 52 | }}} |
| | 53 | |
| | 54 | * 產生的檔案會放在 /opt/hadoop/build 內 |
| | 55 | |
| | 56 | = 問題 = |
| | 57 | * 執行 ant tar 時,depends 了七個動作: compile, jar, javadoc, docs, api-report, jar-test 。然而docs這個動作一直編譯不過。 |
| | 58 | |
| | 59 | {{{ |
| | 60 | $ ant -Djava5.home=/usr/lib/jvm/java-1.5.0-sun -Dforrest.home=/opt/forrest-0.8 tar |
| | 61 | }}} |
| | 62 | 出現錯誤訊息 |
| | 63 | {{{ |
| | 64 | [exec] Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file |
| | 65 | }}} |