Walter's Hadoop learning note Four Configuring the Eclipse development Environment for Hadoop

Source: Internet
Author: User
Keywords nbsp. selecting compiling learning notes
Walter's Hadoop learning notes four Configure the Eclipse development environment for Hadoop Blog category: Hadoop http://www.aliyun.com/zixun/aggregation/13835.html ">ubuntu 12.04hadoopeclipsewalter

Compile the Hadoop-eclipse-plugin-1.0.4.jar package in the Ubuntu 12.04 environment.

1. In Eclipse, select File-->import-->existing Projects into workspace to import existing projects, assuming the path is:

$HADOOP _home/src/contrib/eclipse-plugin, the default project name is Mapreducetools. After import because the Hadoop-core.jar package is not found, so the project has a red exclamation point, do not worry about it "after the Lib package to join will disappear"

2, the default project name is Mapreducetools, and then the new Lib directory in the project Mapreducetools, First, the Hadoop-core-1.0.4.jar in Hadoop is renamed to Hadoop.core.jar, and the Commons-cli-1.2.jar of Hadoop.core.jar, its Lib directory, Commons-lang-2.4.jar, Commons-configuration-1.6.jar, Jackson-mapper-asl-1.8.8.jar, Jackson-core-asl-1.8.8.jar, Commons-httpclient-3.0.1.jar copy to the directory.

3, will $hadoop_home/src/contrib/ Build-contrib.xml (that is, with the Eclipse-plugin package in the same level directory) is copied to the Eclipse project directory, and the Build-contrib.xml is modified to change the property hadoop.root,eclipse.home to a storage directory on the local computer. and modify the currently used Hadoop version number. eg:


<property name= "Hadoop.root" location= "/home/hadoop/downloads/hadoop-1.0.4"/>
<property name= "Eclipse.home" location= "/home/hadoop/downloads/eclipse"/>

<property name= "Version" value= "1.0.4"/>



4. Modify Build.xml

  <target name= "jar" depends= "compile" unless= "Skip.contrib"
    <mkdir dir= "${" Build.dir}/lib "/>
    <copy file=" ${hadoop.root}/hadoop-core-${version}.jar "tofile=" ${ Build.dir}/lib/hadoop-core.jar "verbose= true"/>
    <copy file= "${hadoop.root}/lib/" Commons-cli-1.2.jar "  todir=" ${build.dir}/lib verbose= "true"/>
    <copy file= "${ Hadoop.root}/lib/commons-lang-2.4.jar "  todir=" ${build.dir}/lib verbose= "true"/>
    < Copy file= "${hadoop.root}/lib/commons-configuration-1.6.jar"   todir= "${build.dir}/lib" verbose= "true"/>
    <copy file= "${hadoop.root}/lib/jackson-mapper-asl-1.8.8.jar"   todir= "${build.dir}/lib" Verbose= "true"/>
    <copy file= "${hadoop.root}/lib/jackson-core-asl-1.8.8.jar"   todir= ${ Build.dir}/lib "verbose= true"/>
    <copy file= "${hadoop.root}/lib/" Commons-httpclient-3.0.1.jar "  TodIr= "${build.dir}/lib" verbose= "true"/>
    <jar
      jarfile= "${build.dir}/ Hadoop-${name}-${version}.jar "
      manifest=" ${root}/meta-inf/manifest. MF "
      <fileset dir=" ${build.dir} "includes=" classes/lib/"/>
      <fileset dir= "${root}" includes= "Resources/plugin.xml"/>
    </jar>
  </target


5. Modify Meta-inf/manifest. MF file, add the jar package under the Lib directory

Bundle-classpath:classes/,
Lib/hadoop-core.jar,
Lib/commons-cli-1.2.jar,
Lib/commons-httpclient-3.0.1.jar,
Lib/jackson-core-asl-1.8.8.jar,
Lib/jackson-mapper-asl-1.8.8.jar,
Lib/commons-configuration-1.6.jar,
Lib/commons-lang-2.4.jar

6, right key to select Project-->export, type select Jar file, plugin.xml file, classes directory, Lib directory and resources directory selected, select the exported jar directory, "Export note, to select using You can export Hadoop-eclipse-plugin-1.0.4.jar files exsiting manifest from workspace (that is, to select the file that you just configured the previous configuration) instead of creating a new manifest file. When I export here, the compiled class file in Hadoop-eclipse-plugin-1.0.4.jar is not included in the classes directory, "There is no classes directory," so create a classes directory first, Cut the compiled class file into the classes directory.

6, after a few steps, the resulting Hadoop-eclipse-plugin-1.0.4.jar package can be used. Then put the file under the Eclipse/plugin directory and restart Eclipse.

Note: Other versions of the compilation method can also be implemented through the above steps.

Reproduced above from http://www.linuxidc.com/Linux/2013-01/77921.htm

Follow the steps did not succeed, do not know where is wrong, so lazy, direct download compiled good. You can download the compiled plug-in from the attachment.

Hadoop-eclipse-plugin-1.0.4.jar (5.4 MB) Download number of times: 0

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.