First, the Environment preparation
1. Install JDK, MAVEN, etc.
2, download the Hadoop source code, and unzip
3, the Tools.jar copied to the classes, the specific reasons see Http://wiki.apache.org/hadoop/HowToSetupYourDevelopmentEnvironment
CD $JAVA _home
mkdir Classes
CP Lib/tools.jar Classes/classes.jar
Otherwise, the following exception will occur:
Missing Tools.jar at:/library/java/javavirtualmachines/jdk 1.7.0 Developer
4, Installation Protobuf
(1): Http://pan.baidu.com/s/1pJlZubT and Unzip
Because you can't access Google, you can only download it by other means.
2. Switch to the Protobuf folder, and in turn, enter it under Terminal:
. /configure
Make
Make check
Make install
When all is done, enter Protoc-version to check if the installation was successful.
Second, compile the source file
MVN eclipse:eclipse-ddownloadsources=true-ddownloadjavadocs=true
Time is longer, if there are other anomalies, then solve each other.
Iii. Importing project with Eclipse
Import hadoop2.6.0 source code to eclipse in Mac