The code for the Hadoop Definitive Guide can be found on the book's website. To compile the code, you will need a Java development environment such as Eclipse or IntelliJ IDEA. For more information on how to set up a Java development environment, please see the following link:
https://www3.ntu.edu.sg/home/ehchua/programming/howto/EclipseJava_HowTo.html
Once you have your development environment set up, you can compile the code by running the following command:
javac -cp hadoop-core-1.2.1.jar *.java
This will compile all of the Java code in the current directory. To run the code, you will need to have a Hadoop cluster up and running. For more information on how to set up a Hadoop cluster, please see the following link:
https://hadoop.apache.org/docs/r1.2.1/cluster_setup.html
Once your Hadoop cluster is up and running, you can run the code by submitting it to the Hadoop cluster. For more information on how to submit code to a Hadoop cluster, please see the following link:
https://hadoop.apache.org/docs/r1.2.1/mapred_tutorial.html#Job+Submission