Win7 Build Hadoop-eclipse-xxx.jar plugin for Hadoop development environment

Source: Internet
Author: User
Tags echo message gz file

  1. Download software

    Download the hadoop-1.2.1.tar.gz. zip file that contains the Hadoop-eclipse plug-in for the package (HTTPS://ARCHIVE.APACHE.ORG/DIST/HADOOP/COMMON/HADOOP-1.2.1/ hadoop-1.2.1.tar.gz)

    Download the apache-ant-1.9.6-bin.tar.gz file for compiling the build plugin (http://mirrors.cnnic.cn/apache//ant/binaries/apache-ant-1.9.6-bin.tar.gz)

    Download Jdk-7u79-windows-x64.exe file (http://125.39.35.144/files/41590000063450B0/download.oracle.com/otn-pub/java/jdk/ 7u79-b15/jdk-7u79-windows-x64.exe)

    Download Eclipse-java-juno-sr2-win32-x86_64.zip file (http://mirror.bit.edu.cn/eclipse/technology/epp/downloads/release/ Juno/sr2/eclipse-java-juno-sr2-win32-x86_64.zip)

  2. Installing the Software

    In addition to the JDK needs to run the installer for installation, both Eclipse and apache-ant are simply decompressed and configured with the environment variables, Hadoop only needs to decompress! The directories in this article are as follows:

    Jdk:d:\program files\java\jdk1.7.0_79

    hadoop:d:\hadoop-1.2.1\hadoop-1.2.1

    Eclipse:d:\program Files\eclipse-java-juno-sr2-win32-x86_64\eclipse

    Apache-ant:d:\program files\apache-ant-1.9.6-bin\apache-ant-1.9.6

  3. Configuring Environment variables

Right click on "Computer", click "Properties", the form will appear

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/77/A1/wKioL1Zqa5nRXGk5AABIc3soJ9A446.png "title=" 1-Right-click Property "alt=" Wkiol1zqa5nrxgk5aabic3soj9a446.png "/>

After clicking "Advanced system Settings", the following window will appear

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/77/A1/wKioL1Zqa_ng2awIAABQwiEHoQw761.png "title=" 2- Environment variables. png "alt=" Wkiol1zqa_ng2awiaabqwiehoqw761.png "/>

After clicking on "Environment variable", the following window will appear

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/77/A1/wKioL1ZqbDPiCXfGAACHrFLvsS4178.png "title=" 3- Environment variables. png "alt=" Wkiol1zqbdpicxfgaachrflvss4178.png "/>

As shown, to create a new three user variable (Ant_home |  CLASSPATH | Java_home)

Ant_home:d:\program files\apache-ant-1.9.6-bin\apache-ant-1.9.6

CLASSPATH:.; %java_home%\lib

Java_home:d:\program files\java\jdk1.7.0_79

Modify the value of the system variable "path" (Select the path row, click the Edit button below, move the cursor to the beginning of the line, and insert

below)

.;D: \ Program Files\apache-ant-1.9.6-bin\apache-ant-1.9.6\bin;d:\program Files\java\jdk1.7.0_79\bin;

Save it!

4. Modify the compilation configuration file

Under the Hadoop decompression directory, open Src\contrib\eclipse-plugin\build.xml and modify the following lines:

Note: The Green part is the new part, the light blue part is the modified part

<project default= "jar" name= "Eclipse-plugin" >
<import file= ". /build-contrib.xml "/>
<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>
</path>

<path id= "Hadoop-core-jar" >
<fileset dir= "${hadoop.root}/" >
<include name= "Hadoop*.jar"/>
</fileset>
</path>

<!--Override classpath to include Eclipse SDK jars--
<path id= "Classpath" >
<pathelement location= "${build.classes}"/>
<pathelement location= "${hadoop.root}/build/classes"/>
<path refid= "Eclipse-sdk-jars"/>

<path refid= "Hadoop-core-jar"/>

</path>

<!--Skip Building if Eclipse.home is unset. -
<target name= "Check-contrib" unless= "Eclipse.home" >
<property name= "Skip.contrib" value= "yes"/>
<echo message= "Eclipse.home unset:skipping Eclipse Plugin"/>
</target>

<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>

<!--Override jar target to specify manifest--
<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-${commons-cli.version}.jar" todir= "${build.dir}/lib" 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>

</project>


Edit Src\contrib\build-contrib.xml

<property name= "version" value= "1.2.1"/>
<property name= "ivy.version" value= "2.1.0"/>
<property name= "eclipse.home" location= "... Eclipse_home ... "/>

Note Replace the eclipse_home with the actual Eclipse installation directory, this article is D:\Program files\eclipse-java-juno-sr2-win32-x86_64\eclipse

5. Compiling plugins

Open the command line, enter directory ... src\contrib\eclipse-plugin, enter Ant compilation. Compile successfully as

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/77/A3/wKiom1ZqcuaRPgHuAACFEJ6F63A864.png "title=" The compilation succeeded. png "alt=" Wkiom1zqcuarpghuaacfej6f63a864.png "/>

The compiled jar plug-in file is under the {hadoop_home}\build\contrib\eclipse-plugin path.

6. Modifying plugins

1) in the D-Disk new Folder Alter_plugin (D:\alter_plugin)

2) Copy the above compiled plug-in to the directory in the previous step

3) right mouse click on the plugin, use WinRAR to decompress

4) Edit D:\alter_plugin\hadoop-eclipse-plugin-1.2.1\META-INF\MANIFEST. MF ( Green modified)

Eclipse-lazystart:true

Bundle-classpath:classes/,lib/hadoop-core.jar,lib/commons-cli-1.2.jar,

Lib/commons-configuration-1.6.jar,lib/commons-httpclient-3.0.1.jar,

Lib/commons-lang-2.4.jar,jackson-core-asl-1.8.8.jar,jackson-mapper-asl-1.8.8.jar
Bundle-vendor:apache Hadoop

5) cmd command line to go to D:\alter_plugin repack jar Plugin Package

Will D:\alter_plugin\hadoop-eclipse-plugin-1.2.1\META-INF\MANIFEST. MF Copy To

D:\alter_plugin\MANIFEST. Mf

The command line executes the jar CVFM Hadoop-eclipse-plugin-1.2.1.jar MANIFEST. Mf-c HADOOP-ECLIPSE-PLUGIN-1.2.1/.

You can generate the compiled Hadoop-eclipse-plugin-1.2.1.jar plugin in the D:\alter_plugin directory!

6. Installing the Hadoop-eclipse Plugin

Copy the plugin into the plugins directory under the Eclipse installation directory

This catalogue is: D:\Program files\eclipse-java-juno-sr2-win32-x86_64\eclipse\plugins

7. Start Eclipse

Select Map/reduce (blue elephant) 650) this.width=650, Window---Open perspective, and other, src= http://pic002.cnblogs.com/ Images/2011/354747/2011112617253029.jpg "/>

Next to the Eclipse console there will be one more tab, called "Map/reduce Locations", right-click in a blank place, select "New Hadoop location ...",:

650) this.width=650, "src=" http://pic002.cnblogs.com/images/2011/354747/2011112617293785.jpg "height="/>

Location name(take a name)
map/reduce Master(filled in according to the Mapred.job.tracker configured in Mapred-site.xml)
DFS Master(filled in according to Fs.default.name configured in Core-site.xml)

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/77/A5/wKiom1ZqeTnBVrfAAABOmEAwi4U613.png "title=" Configure Hadoop.png "alt=" Wkiom1zqetnbvrfaaabomeawi4u613.png "/>

At this point, the left "Project Explorer" will appear in the configured HDFs, right-click, you can create new folders, delete folders, upload files, download files and other operations.

Note: If the operation is complete, no immediate display in Eclipse, right-click to refresh.


At this point, compiling the Hadoop-eclipse plugin and installing to eclipse is complete! If there are flaws in the text, please correct me!


This article is from the "Keyman" blog, make sure to keep this source http://keyman.blog.51cto.com/9807984/1722052

Win7 Build Hadoop-eclipse-xxx.jar plugin for Hadoop development environment

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.