You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by Nirmal Kumar <ni...@yahoo.com> on 2013/06/10 12:14:29 UTC

Re: How to run MIA Kmean Code.

http://stackoverflow.com/questions/11479600/how-do-i-build-run-this-simple-mahout-program-without-getting-exceptions



________________________________
 From: Apurv Khare <Ap...@lntinfotech.com>
To: "mahout-user@apache.org" <ma...@apache.org>; "user@hadoop.apache.org" <us...@hadoop.apache.org> 
Sent: Sunday, 9 June 2013, 17:26
Subject: How to run MIA Kmean Code.
 


 
Hi all,
 
I was trying to run the example from Mahout in action Chapter 7(k-Mean Clustering).Can somebody guide me how to run that example in a Hadoop Cluster(single Node CDH-4.2.1) with Mahout(0.7)
 
These are the steps i followed:
1.     Copied the code( from Github)into my Eclipse IDE, on my local machine. 
2.     Incuded these jars into my Eclipse project. 
           hadoop-common-2.0.0-cdh4.2.1.jar, hadoop-hdfs-2.0.0-cdh4.2.1.jar, hadoop-mapreduce-client-core-2.0.0-cdh4.2.1.jar, mahout-core-0.7-cdh4.3.0.jar
         mahout-core-0.7-cdh4.3.0-job.jar, mahout-math-0.7-cdh4.3.0.jar
3.     Made a Jar of this project and copied that jar onto my Hadoop Cluster
4.     Executed this command 
        user@INFPH01463U:~$ hadoop jar /home/user/apurv/Kmean.jar tryout.SimpleKMeansClustering
   which gave me following Error
Exception in thread "main" java.lang.NoClassDefFoundError: FileSystem
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getMethod0(Class.java:2670)
        at java.lang.Class.getMethod(Class.java:1603)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:202)
Caused by: java.lang.ClassNotFoundException: FileSystem
        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 java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 5 more
 
Can anyone let me know how to add proper jars IN CDH4, I think I’m facing issues with jars. If not please can anyone let me know what I missed in this.
 
Thanks & Regards,
Apurv Khare
 
________________________________
 The contents of this e-mail and any attachment(s) may contain confidential or privileged information for the intended recipient(s). Unintended recipients are prohibited from taking action on the basis of information in this e-mail and using or disseminating the information, and must notify the sender and delete it from their system. L&T Infotech will not accept responsibility or liability for the accuracy or completeness of, or the presence of any virus or disabling code in this e-mail"