The first afternoon + one night + one morning exploration by a newbie leaves the following experiences for new beginners:
1. Create a Java project in eclipse with a random name.
2. decompress the hadoop 1.0.2 directory \ SRC \ contrib \ eclipse-plugin and drag all the files to the project. The build-contrib.xml under the \ SRC \ contrib directory is also dragged to the project. Drag all jar files under the hadoop root directory to the bin directory of the eclipse project. (In Linux: You need to change the package name in SRC. You can drag the SRC \ Java \ org folder to the SRC of the eclipse project; you do not need to copy the jar package under the hadoop root directory to the bin directory, because there is no bin... Just add the user library. Right-click the project name and choose build.
Path-add libraries select plugin dependencies-next-finish)
3. Modify build-contrib.xml: Find <property name = "hadoop. root "location =" $ {root }/.. /.. /.. /"/> change location to hadoop1.0.2. decompress the Directory and add
<Property name = "Eclipse. Home" location = "D:/programming/Eclipse"/>
<Property name = "version" value = "1.0.2"/>
The specific location must be changed to yours. Pay attention to the slash direction in the location.
4. Modify build. xml: Find <import file = "../build-contrib.xml"/> and change to <import file = "build-contrib.xml"/>.
5. Copy two jar files in the decompressed hadoop directory. create these directories if there is no directory. Are: \ hadoop-core-1.0.2.jar to \ build \ hadoop-core-1.0.2.jar; \ Lib \ commons-cli-1.2.jar to \ build \ Ivy \ Lib \ hadoop \ common \ commons-cli-1.2.jar. (If there is no subsequent jar package, run build. XML in Step 6 and the package will be automatically downloaded)
6. Right-click build. XML in eclipse and choose run as-ant build. Wait for a short meeting. The compiled file is hadoop-eclipse-plugin-1.0.2.jar in: \ build \ contrib. (In Linux: according to the method used to drag the org folder, an error is reported here. Similar to: build failed/home/darkylin/workspace/contrib/build. xml: 62: srcdir "/home/darkylin/workspace/contrib/src/Java" does
Not Exist! Modifying build-contrib.xml) <property name = "src. dir "location =" $ {root}/src/Java "/> to remove/Java from the last part of location. If so, a compilation error is reported, prompting"The software package org. Apache. hadoop. FS does not exist."See Appendix 1)
7. This jar package does not work yet. Although you can create a view and create a location, errors may occur during connection. Without the jar package for hadoop, [Reference 1] Will/lib directory under the commons-configuration-1.6.jar, commons-httpclient-3.0.1.jar, commons-lang-2.4.jar, 5 packages, such as jackson-core-asl-1.8.8.jar and jackson-mapper-asl-1.8.8.jar, are copied to the lib directory of the hadoop-eclipse-plugin-1.0.2.jar (use WinRAR to open the hadoop-eclipse-plugin-1.0.2.jar, drag it into the line ). Then, modify manifest. MF under the META-INF directory of the package and change classpath to the following:
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.
8. At this point, this plug-in is compiled. We recommend that you use the Link Method to mount it to eclipse. [Reference 3]
9, use can refer to: http://hi.baidu.com/geogre_jsj/blog/item/f5bd4065fb99b1c081cb4a88.html#0
10. Pay attention to "10. in the pop-up dialog box, fill in according to the port in the core-site.xml and the mapred-site.xml: "Port port number fill order: first the port number configured in the mappred-site.xml, then the port number configured in the core-site.xml. [Reference 2]
Reference: 1. http://blog.csdn.net/matraxa/article/details/7182382
2. http://www.360doc.com/content/10/0803/13/2159920_43357680.shtml
3. http://hi.baidu.com/zlhxinxi83/blog/item/67456f33ed9590fe1a4cff99.html
Appendix 1:
Add the following in build. xml:
<Path id = "hadoop-jars">
<Fileset dir = "$ {hadoop. Root}/">
<Include name = "hadoop-*. Jar"/>
</Fileset>
</Path>
In <path id = "classpath"> Add: <path refID = "hadoop-jars"/>