Associating Hadoop Source to eclipse
ant:http://archive.apache.org/dist/ant/binaries/
Hadoop:http://archive.apache.org/dist/hadoop/core/
All Versions jdk:http://www.oracle.com/technetwork/java/archive-139210.html
eclipse:http://www.eclipse.org/downloads/
Eclipse Downloads This version:
1. Prepare the software and environment:
The following versions of Ant and Hadoop are used in this article:
Eclipse creates a Java project project.
Ant is the build tool that Apache provides to Java developers, it can run under Windows OS and UNIX OS, it's not only open source but also a very useful tool
2. Copy the core, HDFs, and mapred from the Hadoop-1.2.1 src directory to the Eclipse project:
Three files in Hadoop-1.2.1:
The copy below will be error, because there is no guide packet, so will error:
The fault here is normal, if there is no error, then the problem:
3, the Project Guide package:
Guide Package One:
The jar in the hadoop-1.2.1 root directory is directed into:
Guide Pack II:
Copy the jar in the Lib in the hadoop-1.2.1:
Guide Package III:
Put the jar in the hadoop-1.2.1/lib/jsp-2.1 into the bag:
Guide Pack IV:
Take the jar in the apache-ant-1.9.4 Lib, and note that only one package is being directed:
4. Select the JDK version:
If the computer is not installed jdk1.6 It is best to install one so that eclipse is easy to use.
This example uses the Hadoop version is hadoop-1.2.1, so it is best to use jdk1.6, with the jdk1.8 version may be error.
Double-click JRE systemlibrary[javase-1.6]
Select the previously installed jdk1.6 version:
Click Finish to exit.
5, click on the link Source, in turn, Core, HDFs, mapred three folders in the guide:
When the import is complete, click Remove to delete the HADOOP-1.2.1/SRC:
Click OK to complete:
6. Successful operation:
Take a look at a class code:
Associating Hadoop Source to eclipse