Import Eclipse Import/compile Hadoop source code

Source: Internet
Author: User

Http://www.cnblogs.com/errorx/p/3779578.html

1. Preparatory work
    • Jdk:
    • Eclipse:
    • Maven:
    • libprotoc:https://developers.google.com/protocol-buffers/
    • hadoop:http://www.apache.org/dyn/closer.cgi/hadoop/common/

Add Open source China Maven Library: http://maven.oschina.net/home.html

Maven\conf\settings.xml

<localRepository>path</localRepository>

<localRepository>path</localRepository>
<mirrors> <mirror> <id>nexus-osc</id> <mirrorOf>*</mirrorOf> <name>nexus osc</name> <url>http://maven.oschina.net/content/groups/public/</url > </mirror></mirrors>

2. Import
    1. Extract the Hadoop source to a directory, note that the directory hierarchy is not too deep, otherwise it may not be decompressed.
    2. Go to Hadoop-maven-plugins folder, execute mvn install
    3. Return to source root directory, execute mvn eclipse:eclipse–dskiptests
    4. Eclipse creates a new workspace in any directory
    5. Eclipse Settings maven:window->preference->maven->{installations...; User Settings:maven\conf\settings.xml}
    6. Eclipse:file->inport->existing Projects into Workspace->hadoop source root directory
3. Error handling
    1. Maven Download POM Failure--re-operation
    2. Hadoop-streaming Build Path Error->java build Path->source:
      1. Delete ... hadoop-yarn-server-resourcemanager/conf
      2. Link Source: Source root directory/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/conf, and a name inclusion patterns:capacity-scheduler.xml;exclusion Patters:**/*.java
    3. Org.apache.hadoop.io.serializer.avro.TestAvroSerialization
      1. Download avro-tools-1.7.4.jar:http://archive.apache.org/dist/avro/avro-1.7.4/java/
      2. Access directory: Source root directory \hadoop-common-project\hadoop-common\src\test\avro
      3. Java-jar Path/to/avro-tools-1.7.4.jar Compile schema AVRORECORD.AVSC. \java
      4. Eclipse Refresh
    4. Org.apache.hadoop.ipc.protobuf.TestProtos
      1. Access directory: Source root directory \hadoop-common-project\hadoop-common\src\test\proto
      2. Protoc--java_out=. /java *.proto
      3. Eclipse Refresh
    5. Project->clean. ->clean all projects & Build the entire workspace

Import Eclipse Import/compile Hadoop source code

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.