Hadoop - Could not find or load main class org.apache.hadoop.hdfs.server.namenode.NameNode

I got this error when I tried to execute hadoop command with namenode and format parameters.

C:\hadoop-2.5.2\bin>hadoop namenode -format
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
Error: Could not find or load main class org.apache.hadoop.hdfs.server.namenode.
NameNode

      

This is the output of the export command. All of these variables are declared as user-defined environment variables.

declare -x CLASSPATH="C:\\hadoop-2.5.2\\share\\hadoop\\common;C:\\Java\\jdk1.7.0_51\\bin;C:\\Java\\jdk1.7.0_51\\jre\\bin;"
declare -x JAVA_HOME="C:\\Java\\jdk1.7.0_51"
declare -x HADOOP_COMMON_HOME="C:\\hadoop-2.5.2"
declare -x HADOOP_HDFS_HOME="C:\\hadoop-2.5.2\\share\\hadoop\\hdfs"
declare -x HADOOP_PREFIX="C:\\hadoop-2.5.2\\bin\\hadoop"
declare -x HADOOP_YARN_HOME="C:\\hadoop-2.5.2\\share\\hadoop\\yarn"


C:\hadoop-2.5.2\bin>hadoop version
Hadoop 2.5.2
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r cc72e9b000545b8
6b75a61f4835eb86d57bfafc0
Compiled by jenkins on 2014-11-14T23:45Z
Compiled with protoc 2.5.0
From source with checksum df7537a4faa4658983d397abf4514320
This command was run using /C:/hadoop-2.5.2/share/hadoop/common/hadoop-common-2.
5.2.jar

      

When I ran the hasoop classpath command, it didn't have any path that any jar file was in, which made me think there was an error here. Can anyone tell if there is really a bug with the classpath?

The path to the env variable has the path to the common directory with the jar files. Should the hadoop classpath be changed? If so, what should I add to it?

declare -x CLASSPATH="C:\\hadoop-2.5.2\\share\\hadoop\\common;C:\\Java\\jdk1.7.0_51\\bin;C:\\Java\\jdk1.7.0_51\\jre\\bin;"

C:\hadoop-2.5.2\bin>hadoop classpath
C:\hadoop-2.5.2\etc\hadoop;C:\hadoop-2.5.2\share\hadoop\common\lib\*;C:\hadoop-2
.5.2\share\hadoop\common\*;C:\hadoop-2.5.2\share\hadoop\hdfs\share\hadoop\hdfs\*
;C:\hadoop-2.5.2\share\hadoop\yarn\share\hadoop\yarn\*;C:\hadoop-2.5.2\share\had
oop\mapreduce\lib\*;C:\hadoop-2.5.2\share\hadoop\mapreduce\*

      

Thanks for the help. Do not put this as a duplicate, as I spent a lot of time going through these streams without any breakouts.

Could not find or load main class while trying to format namenode; hadoop installation on MAC OS X 10.9.2 Could not find or load main class org.apache.hadoop.hdfs.server.namenode.Namenode

+3


source to share





All Articles