Ubuntu: name node formatting HDFS file not found error in Hadoop2.4.0


I have installed my hadoop in /usr/local/hadoop directory

when i try to run the commeand $ bin/hdfs namenode -format im the getting the error

/usr/local/hadoop/bin/hdfs: line 206: usr/jvm/java-7-openjdk-amd64/bin/java : no such file or directory

i have edited the configuration file vim etc/hadoop/core-site.xml

fs.defaultFS hdfs://localhost:9000


dfs.replication 1

Thanks in advance for your answers and replies.


First, check whether JAVA_HOME is set correctly in .bashrc file. Use echo $JAVA_HOME to check whether it is set or not. If not, set it using

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64  

Note: After making changes to .bashrc file, you'll need to reload it either by logging out and back in or by using . ~/.bashrc as pointed out in "How do I reload .bashrc without logging out and back in?".

It seems like the JAVA_HOME variable is incorrectly set in your hadoop-env.sh. Set JAVA_HOME to /usr/lib/jvm/java-7-openjdk-amd64 instead of usr/jvm/java-7-openjdk-amd64. as it is set currently (pointed out by the error).


export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"  

in your hadoop-env.sh file.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »