title: Unable to compile java files to class files for hadoop
body: <p>I am using hadoop 2.6.4 and trying to compile java file using the following command:</p>
  
  <pre><code>javac -classpath $HADOOP_HOME/share/hadoop/common/hadoop-common-2.6.4.jar:$HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.6.4.jar:$HADOOP_HOME/share/hadoop/common/lib/commons-cli-1.2.jar -d class_files *.java
  </code></pre>
  
  <p>But this is not compiling the files due to missing hadoop packages:</p>
  
  <pre><code>GraphSearch.java:28: error: package org.apache.hadoop.conf does not exist
  import org.apache.hadoop.conf.Configured;
                           ^
  GraphSearch.java:29: error: package org.apache.hadoop.fs does not exist
  import org.apache.hadoop.fs.Path;
                         ^
  GraphSearch.java:30: error: package org.apache.hadoop.io does not exist
  import org.apache.hadoop.io.IntWritable;
                         ^
  GraphSearch.java:31: error: package org.apache.hadoop.io does not exist
  import org.apache.hadoop.io.LongWritable;
                         ^
  GraphSearch.java:32: error: package org.apache.hadoop.io does not exist
  import org.apache.hadoop.io.Text;
                         ^
  GraphSearch.java:33: error: package org.apache.hadoop.mapred does not exist
  import org.apache.hadoop.mapred.*;
  ^
  GraphSearch.java:34: error: package org.apache.hadoop.util does not exist
  import org.apache.hadoop.util.Tool;
                           ^
  GraphSearch.java:35: error: package org.apache.hadoop.util does not exist
  import org.apache.hadoop.util.ToolRunner;
                           ^
  GraphSearch.java:52: error: cannot find symbol
  public class GraphSearch extends Configured implements Tool {
  </code></pre>
  
  <p>Tried setting the classpath using the following command, not sure whether its correct:</p>
  
  <pre><code>export CLASSPATH=$CLASSPATH:/usr/local/hadoop/share/hadoop/common/hadoop-common-2.6.4.jar:$/usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.6.4.jar:/usr/local/hadoop/share/hadoop/common/lib/commons-cli-1.2.jar
  </code></pre>
  
  <p>Kindly help!</p>