java.lang.classnotfoundexception:org.apache.hadoop.util.programdriver

xdnvmnnf  于 2021-06-03  发布在  Hadoop
关注(0)|答案(2)|浏览(487)

我试图在本地系统上运行mahout,当我运行“../bin/mahout”时,出现下面提到的错误。我所要做的就是在没有hadoop的情况下运行mahout,并尝试20newsgroup示例。
我在core、distribution和example目录中执行了“mvncomile”和“mvn install-dmaven.test.skip=true”。不知道我还缺什么。我知道你可以在没有hadoop的情况下运行mahout。
如果有人能帮忙,我将不胜感激。

hadoop binary is not in PATH,HADOOP_HOME/bin,HADOOP_PREFIX/bin, running locally
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/Aanchal/mahout-distribution-0.7/mahout-examples-0.7-job.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/Aanchal/mahout-distribution-0.7/lib/slf4j-jcl-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/Aanchal/mahout-distribution-0.7/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/util/ProgramDriver
    at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:96)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.ProgramDriver
    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:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
tzdcorbm

tzdcorbm1#

此异常表示在类路径上找不到该类,即我们正在尝试加载类定义,而包含该类的class/jar在类路径中不存在。
请检查路径和hadoop\u主配置,并相应地更新这些变量。

o2rvlv0m

o2rvlv0m2#

添加此行

CLASSPATH=${CLASSPATH}:$MAHOUT_HOME/lib/hadoop/hadoop-core-0.20.204.0.jar;

到mahout.sh/bat文件中节的末尾


# add release dependencies to CLASSPATH

for f in $MAHOUT_HOME/lib/*.jar; do 
  CLASSPATH=${CLASSPATH}:$f; 
done

相关问题