org.apache.hadoop.hdfs.server.namenode.NameNode.

studywell發表於2015-04-20

轉:http://blog.csdn.net/cnmilan/article/details/7986750

Could not find the main class: org.apache.hadoop.hdfs.server.namenode.NameNode.解決方法

hadoop-0.21.0 配置好1.core-site.xml 2.hdfs-site.xml 3.mapred-site.xml 格式化namenode 報錯
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hdfs/server/namenode/NameNode
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hdfs.server.namenode.NameNode
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.apache.hadoop.hdfs.server.namenode.NameNode.  Program will exit.
 
解決辦法:修改 conf/hadoop-env.sh,增加
                  export HADOOP_COMMON_HOME=/usr/hadoop/hadoop (hadoop的安裝目錄)

 


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29519108/viewspace-1587381/,如需轉載,請註明出處,否則將追究法律責任。