当我运行Mahout的k-Means时,总是显示此提示

时间:2019-03-21 03:37:35

标签: java hadoop k-means hadoop2 mahout

代码:

hadoop jar /home/xnz/local/opt/apache-mahout-distribution-0.13.0/mahout-integration-0.13.0.jar \
    org.apache.mahout.clustering.conversion.InputDriver \
    -i /user/root/ -o /user/root/input/seqfile

错误提示:

Exception in thread "main" java.lang.NoClassDefFoundError: 
    org/apache/commons/cli2/OptionException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:278)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:214)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: java.lang.ClassNotFoundException: 
    org.apache.commons.cli2.OptionException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:359)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:430)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:363)
    ...4 more
``

1 个答案:

答案 0 :(得分:1)

从异常可以明显看出。您在类路径中缺少org.apache.commons.cli2 Jar。