问题
I'm using my school's server which already have hadoop and mahout. But I need to parse csv to vector. So I tried someone else code from git. But I got the following exception which I can't solve.
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
Thank you very much.
My jar has already including mahout-math...jar and mahout-core...jar and some other jar.
回答1:
I missed the package mahout-collections-1.0.jar.
来源:https://stackoverflow.com/questions/30544415/mahout-intdoubleprocedure-noclassdeffounderror