Mahout IntDoubleProcedure NoClassDefFoundError

时间:2015-05-30 09:22:18

标签: java hadoop noclassdeffounderror mahout

我正在使用已经有hadoop和mahout的学校服务器。 但是我需要将csv解析为vector。所以我尝试了别人的代码来自git。 但我得到了以下例外,我无法解决。

dcmac04:dir username$ java -jar BigDataNaiveBayes_fat.jar 
May 30, 2015 1:48:17 AM org.apache.hadoop.util.NativeCodeLoader <clinit>
WARNING: Unable to load native-hadoop library for your platform... using    builtin-java classes where applicable
May 30, 2015 1:48:17 AM org.apache.hadoop.io.compress.CodecPool getCompressor
INFO: Got brand-new compressor

Exception in thread "main" java.lang.NoClassDefFoundError:  
 org/apache/mahout/math/function/IntDoubleProcedure
  at NaiveBayes.CsvToVectors.vectorize(CsvToVectors.java:53)
  at NaiveBayes.MahoutTest.csv2vectors(MahoutTest.java:53)
  at NaiveBayes.MahoutTest.main(MahoutTest.java:149)
Caused by: java.lang.ClassNotFoundException: org.apache.mahout.math.function.IntDoubleProcedure
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  ... 3 more

非常感谢。

我的jar已经包含了mahout-math ... jar和mahout-core ... jar和其他一些jar。

1 个答案:

答案 0 :(得分:0)

我错过了包mahout-collections-1.0.jar。