Welcome to the Csdn-markdown Editor

Source: Internet
Author: User
Tags lenovo

The main thing is to do a zip package of source files. And then attach it to eclipse to be OK.

I. Environmental description

System: Ubuntu 14.04 32 bit
Jdk:javac 1.7.0_75
Eclipse version::3.8.1
Hadoop version:2.4.1

Second, download and unzip the source code 1, download

: http://pan.baidu.com/s/1jGCGL98
Extract Password: Brup

2. Create a Directory
young@young-Lenovo-G470:~$ mkdir hadoop-srcyoung@young-Lenovo-G470:~$ cd hadoop-srcyoung@young-Lenovo-G470:~/hadoop-src$ mkdir org && mkdir org/apache && mkdir org/apache/hadoop

Copy the hadoop-2.4.1-src.tar.gz to the ~/HADOOP-SRC directory.

3. Decompression
young@young-Lenovo-G470:~/hadoop-src$ tar -xvf hadoop-2.4.1-src.tar.gzyoung@young-Lenovo-G470:~/hadoop-src$ lshadoop-2.4.1-src  hadoop-2.4.1-src.tar.gz  org
Third, packaging source

Because the source of Hadoop at this time is more dispersed, we will need to set up the source code into a. zip file attached to eclipse.
Copy some of the source code in the HADOOP-2.4.1-SRC (here only the MapReduce and HDFs related source code) to Org/apache/hadoop.

Young@young-Lenovo-G470: ~/hadoop-src$ Cp-r ~/hadoop-src/hadoop-2.4.1-src/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/ hadoop/* Org/apache/hadoop/young@young-Lenovo-G470: ~/hadoop-src$ Cp-r ~/hadoop-src/hadoop-2.4.1-src/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/* Org/apache/hadoop/young@young-Lenovo-G470: ~/hadoop-src$ Zip-r Hadoop-src.zip./org
Iv. Attaching to eclipse

Open Eclipse, right-click a project, build path, Configure build path, Add External JARs
Find the hadoop-src.zip that you just packed, check, OK.

V. Testing

Open a Hadoop project that contains the Reducer class, hold down CTRL, and click Reducer. If normal, you can see the beautiful source code.

Attachment

The following is my own good zip package, basically a complete Hadoop2.4.1 source package.
: HTTP://PAN.BAIDU.COM/S/1BNB9JTL
Extract Password: 3pmy

Welcome to the Csdn-markdown Editor

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.