我正在使用我学校的服务器,它已经有了hadoop和mahout。但我需要把csv解析成向量。所以我尝试了其他人的代码从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数学…jar和mahout核心…jar和其他一些jar。
1条答案
按热度按时间oaxa6hgo1#
我错过了mahout-collections-1.0.jar包。