Hadoop-1.2.1 Eclipse Plugin Compilation

Source: Internet
Author: User
Tags echo message



The Eclipse development process connects to the Hadoop cluster environment and requires the installation of the Hadoop plugin. The source code for the Eclipse plugin is in the Hadoop source package and needs to be compiled yourself.



Environment: Hadoop 1.2.1 & Eclipse Kepler & Windows 7 & JAVA 7



1. Generate Plugin Source code



Unzip the Hadoop installation package and find Src\contrib\eclipse-plugin



2. Modify the configuration



Modify ${hadoop_home}/src/contrib/ under the directory Build-contrib.xml file, add two lines:


 
 
<property name="version" value="1.2.1"/> 
<property name="eclipse.home" location="E:\eclipse"/>


Modify The ${hadoop_home}/src/contrib/eclipse-plugin/build.xml file to add two lines (Red flag):


 
<path id="eclipse-sdk-jars">
    <fileset dir="${eclipse.home}/plugins/">
      <include name="org.eclipse.ui*.jar"/>
      <include name="org.eclipse.jdt*.jar"/>
      <include name="org.eclipse.core*.jar"/>
      <include name="org.eclipse.equinox*.jar"/>
      <include name="org.eclipse.debug*.jar"/>
      <include name="org.eclipse.osgi*.jar"/>
      <include name="org.eclipse.swt*.jar"/>
      <include name="org.eclipse.jface*.jar"/>

      <include name="org.eclipse.team.cvs.ssh2*.jar"/>
      <include name="com.jcraft.jsch*.jar"/>
    </fileset> 
    <fileset dir="../../../"> 
        <include name="hadoop*.jar"/>
    </fileset> 
</path>


Delete a row (red flag):


 
 
<target name="compile" depends="init, ivy-retrieve-common" unless="skip.contrib">
    <echo message="contrib: ${name}"/>
    <javac
     encoding="${build.encoding}"
     srcdir="${src.dir}"
     includes="**/*.java"
     destdir="${build.classes}"
     debug="${javac.debug}"
     deprecation="${javac.deprecation}">
     <classpath refid="classpath"/>
    </javac>
</target>


Create a new directory hadoop-1.1.2\ build\ivy\lib\hadoop\common\ in hadoop-1.1.2and Hadoop-1.1.2\lib\commons-cli-1.2.jar copied to this directory.



will be Hadoop-1.1.2\hadoop-core-1.1.2.jar files are copied to Hadoop-1.1.2\build directory.



3. Compile the Plugin



With Ant compilation, the system must have ant installed, and if it is not installed, first download the ant installation package, configure the system environment variables, and add E:\apache-ant-1.9.4\bin to path.



After installation, the command line enters src\contrib\eclipse-plugin and the Ant Jar is entered for compilation.



After the compilation is successful, build in the hadoop-1.1.2\build\contrib\eclipse-plugin\ directory Hadoop-eclipse-plugin-1.1.2.jar plugin .



Note that the compilation process requires networking.



4. Configuring Eclipse



Copy the compiled Hadoop-eclipse-plugin-1.1.2.jar into Eclipse's plugins and restart Eclipse.



Open Eclipse, set the Hadoop installation path in Window-preperences-hadoop Map/reduce, set the cost location.



Toggle Eclipse View, select Map/reduce


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.