Operating system: Ubuntu
Hadoop version: 1.0.1
Eclipse Version: Eclipse HELIOS-SR2
The eclipse plug-in generated directly from the Hadoop 1.0.1 mask plugin is not available because some jar packages are missing, so you need to manually modify the Build.xml files and meta-inf/in the Src/contrib/eclipse-plugin directory MANIFEST. MF file.
Modify the Build.xml file
It's not a modification.
<target name= "Jar" depends= "compile" unless= "Skip.contrib" > <mkdir dir= "${build.dir}/lib"/> <copy fil E= "${hadoop.root}/build/hadoop-core-${version}.jar" tofile= "${build.dir}/lib/hadoop-core.jar" verbose= "true"/ > <copy file= "${hadoop.root}/build/ivy/lib/hadoop/common/commons-cli-${commons-cli.version}.jar" todir= "${ Build.dir}/lib "verbose=" true "/> jarfile=" ${build.dir}/hadoop-${name}-${version}.jar "manifest=" ${root}/META- Inf/manifest. MF "> <fileset dir=" ${build.dir} "includes=" classes/lib/"/> <fileset dir=" ${root} "includes=" Resourc Es/plugin.xml "/> </jar> </target>
Modify it on this basis and modify it to
<target name= "Jar" depends= "compile" unless= "Skip.contrib" > < Mkdir dir= "${build.dir}/lib"/> <copy file= "${hadoop.root}/build/ Hadoop-core-${version}.jar " tofile=" ${build.dir}/lib/hadoop-core.jar " verbose=" true "/> <copy file= "${hadoop.root}/build/ivy/lib/hadoop/common/commons-cli-${ Commons-cli.version}.jar " todir=" ${build.dir}/lib " verbose=" true "/> <copy file= "${hadoop.root}/build/ivy/lib/hadoop/common/commons-configuration-1.6.jar" todir= "${build.dir}/lib" verbose= "true"/> <copy file= "${hadoop.root}/build/ivy/lib/hadoop/common/commons-lang-2.4.jar" todir= "${build.dir}/ Lib " verbose=" true "/> <copy file=" ${hadoop.root}/build/ivy/ Lib/hadoop/common/jackson-core-asl-1.8.8.jar " todir= "${build.dir}/lib" verbose= "true"/> <copy file= "${hadoop.root}/build/ivy/lib/hadoop/common/jackson-mapper-asl-1.8.8.jar" todir= "${build.dir}/lib" verbose= "true"/> <copy file= "${hadoop.root}/build/ivy/lib/ Hadoop/common/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>
2. Modify the Meta-inf/manifest. MF File
It's not a modification.
Bundle-classpath:classes/,lib/hadoop-core.jar
Modify it on this basis and modify it to
bundle-classpath:classes/,lib/hadoop-core.jar,lib/commons-cli-1.2.jar,lib/commons-configuration-1.6.jar,lib/ commons-lang-2.4.jar,lib/jackson-core-asl-1.8.8.jar,lib/jackson-mapper-asl-1.8.8.jar,lib/ Commons-httpclient-3.0.1.jar
Note To add all the jar packages defined in the Build.xml, I was the first to write less lib/commons-cli-1.2.jar, resulting in the use of or have been reported error:failure to login error, tossing for a long time (by the Hadoop Technology Insider "this book is misleading."
3. Compile the Build plugin jar package
command line into the Src/contrib/eclipse-plugin directory under the Hadoop installation directory, enter the following command:
Ant-declipse.home=/home/jason/eclipse-dversion=1.0.2-snapshot
Where eclipse.home is used to specify the path to eclipse, version is the release number of Hadoop.
Finally, you will see the generated jar package in the Build/contrib/eclipse-plugin directory under the Hadoop installation directory, and copy it to the Eclipse's plugin directory.
Compiling the Eclipse Hadoop plugin