Compile Hadoop 2.7 on Eclipse on Ubuntu 15.04

  1. Install libtool: sudo apt-get install libtool 
  2. Install protoc 2.5: http://stackoverflow.com/questions/29797763/how-do-i-install-protobuf-2-5-on-arch-linux-for-compiling-hadoop-2-6-0-using-mav
  3. Git clone hadoop-common and compile using Maven then import into Eclipse: https://wiki.apache.org/hadoop/EclipseEnvironment
  4. Make sure Eclipse uses officially supported JRE: https://wiki.apache.org/hadoop/HadoopJavaVersions, http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-add_new_jre.htm
  5. You may still find some class cannot be resolved, or some import package can’t be resolved. This is due to that Maven generates some java files that Eclipse doesn’t know how to link. The only way to do that is to move those mvn generated files (usually in `some nested directory/target/generated-sources or generated-test-sources`) to the correct place as indicated from the Eclipse error message.
  6. For other miscellaneous errors you can refer to http://diary-of-programmer.blogspot.com/2014/11/hadoop-tips-hadoop-build-error-related-findbugs-protobuf-avro.html
  7. Run the word count example to test!

Leave a comment

Your email address will not be published. Required fields are marked *