title: How hadoop command works with javac
body: <p>I was reading Apache <a href="http://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html#Example:_WordCount_v1.0" rel="nofollow">mapreduce tutorial</a></p>
  
  <p>I was able to run the example and get the desired result. However, I am not able to understand how it is asked that we should run following to compile the Java file.</p>
  
  <blockquote>
    <p>$ bin/hadoop com.sun.tools.javac.Main WordCount.java </p>
  </blockquote>
  
  <p>I went through the <a href="http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/CommandsManual.html#fs" rel="nofollow">hapdoop command details</a>. It partitioned all hadoop switches under General options, User commands and Administrator commands. I didnt found where above <code>javac</code> command given in hadoop command page.</p>
  
  <p><strong>Q</strong>. In fact actually I didnt get how above command works. I mean we usually specify hyphen-prefixed options in front of the commands. However this above command asks to run javac in a way that I never saw before. I usually used to compile java files directly by <code>javac filename.java</code>. Why here it is asked to not do this way?</p>
  
  <p><strong>Q</strong>. Also there is <code>.Main</code> in <code>com.sun.tools.javac.Main</code> in the given command. What does this mean?</p>
  
  <p><strong>I know I must be missing something very basic understanding about how commands works in general. Also I am very new to linux, so may be thats the reason for not understanding this.</strong></p>