First, you are using wrong command. Correct one is hadoop version
( in hadoop 2.4.1)
It seems that java path is not set. It is required to run hadoop.
Type java -version
in the terminal. You should be able to see output of Java Version installed. If not, install java jdk
Type sudo apt-get install openjdk-7-jdk
and install Java OpenJDK.
Now set JAVA_HOME variable in
1. /etc/environment file
Open /etc/environment by typing sudo gedit /etc/environment
in terminal.
At the end, Paste this line export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64/"
where this is the java path. Usually this is where java is installed.
2. .bashrc file (different for each user)
Open .bashrc file by typing sudo gedit ~/.bashrc
in terminal.
At the end, Paste this export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64/"
where this is the java path.
3. Now reload settings by typing source /etc/environment
and source ~/.bashrc
in the terminal
Test it by typing echo $JAVA_HOME
in terminal , it should show your java home directory.
Do the same for to set HADOOP_HOME variable also.