title: Hadoop: Formatting the HDFS filesystem via the NameNode in Ubuntu 12.04
body: <p>I am following this tutorial <a href="http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/" rel="nofollow">http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/</a></p>
  
  <p>note: yes I know I did install hadoop to /usr/local/hadoop/hadoop/ but the tutorial does not</p>
  
  <p>When I run:</p>
  
  <pre><code>hduser@ubuntu:~$ /usr/local/hadoop/hadoop/bin/hadoop namenode -format
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>Warning: $HADOOP_HOME is deprecated.
  
  /usr/local/hadoop/hadoop/bin/hadoop: line 320: /usr/lib/jvm/java-6-sun/bin/java: No such  file or directory
  /usr/local/hadoop/hadoop/bin/hadoop: line 390: /usr/lib/jvm/java-6-sun/bin/java: No such file or directory
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>hduser@ubuntu:/usr/local/hadoop$ hadoop/bin/hadoop namenode -format
  10/05/08 16:59:56 INFO namenode.NameNode: STARTUP_MSG:
  /************************************************************
  STARTUP_MSG: Starting NameNode
  STARTUP_MSG:   host = ubuntu/127.0.1.1
  STARTUP_MSG:   args = [-format]
  STARTUP_MSG:   version = 0.20.2
  STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches    /branch-0.20 -r 911707; compiled by 'chrisdo' on Fri Feb 19 08:07:34 UTC 2010
  ************************************************************/
  10/05/08 16:59:56 INFO namenode.FSNamesystem: fsOwner=hduser,hadoop
  10/05/08 16:59:56 INFO namenode.FSNamesystem: supergroup=supergroup
  10/05/08 16:59:56 INFO namenode.FSNamesystem: isPermissionEnabled=true
  10/05/08 16:59:56 INFO common.Storage: Image file of size 96 saved in 0 seconds.
  10/05/08 16:59:57 INFO common.Storage: Storage directory .../hadoop-hduser/dfs/name has    been successfully formatted.
  10/05/08 16:59:57 INFO namenode.NameNode: SHUTDOWN_MSG:
  /************************************************************
  SHUTDOWN_MSG: Shutting down NameNode at ubuntu/127.0.1.1
  ************************************************************/
  </code></pre>
  
  <p>in the code for /usr/local/hadoop/hadoop/bin/hadoop line 320 is:</p>
  
  <pre><code>JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} -Xmx32m ${HADOOP_JAVA_PLATFORM_OPTS}           
  org.apache.hadoop.util.PlatformName | sed -e "s/ /_/g"`
  </code></pre>
  
  <p>and line 390 is:</p>
  
  <pre><code>    exec "$JAVA" -Dproc_$COMMAND $JAVA_HEAP_MAX $HADOOP_OPTS -classpath "$CLASSPATH" $CLASS "$@"
  </code></pre>
  
  <p>Any idea how I can fix this?</p>