Return-Path: Delivered-To: apmail-lucene-mahout-user-archive@minotaur.apache.org Received: (qmail 42322 invoked from network); 4 Sep 2009 23:01:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Sep 2009 23:01:29 -0000 Received: (qmail 21231 invoked by uid 500); 4 Sep 2009 23:01:29 -0000 Delivered-To: apmail-lucene-mahout-user-archive@lucene.apache.org Received: (qmail 21141 invoked by uid 500); 4 Sep 2009 23:01:28 -0000 Mailing-List: contact mahout-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mahout-user@lucene.apache.org Delivered-To: mailing list mahout-user@lucene.apache.org Received: (qmail 21131 invoked by uid 99); 4 Sep 2009 23:01:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2009 23:01:28 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of srowen@gmail.com designates 209.85.219.222 as permitted sender) Received: from [209.85.219.222] (HELO mail-ew0-f222.google.com) (209.85.219.222) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2009 23:01:20 +0000 Received: by ewy22 with SMTP id 22so1272340ewy.28 for ; Fri, 04 Sep 2009 16:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=/OU3JGs1UIeINeAjlA6mh3/4ecxhbQcCa/3+FAN2usY=; b=MquFwlbguM0RBrQU87G8uAmCuo0F1yHD6MZQdTEb5YHwhm+3F3lV9kwMmpz+c5Fn2O eGFF6f+2hqzvpNResUnG+cxNW/MgASBlHj9u8Ir5bTw9xQ+CNuP4M73Nr8hsLIBjL+v/ JqudUmQWVVxct4RJiDyGN1Q1D6DREP7iPMZqg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=RFmdsIFmxwoRFEiJ+28t6xptcZIWVsv9quDCHBzDYak/+hmwYbYojBjp8R2fUHICh9 dZhct5X97r5k+FndbYQFWpqtIC3UbY2gJ+hUuww2kbJstbUvO9/S189gLT8bhK0NWOfs itIiwDJt5d2rFy1AZb8zdcyEF3D66L91rovW8= MIME-Version: 1.0 Received: by 10.216.88.7 with SMTP id z7mr2379695wee.19.1252105258989; Fri, 04 Sep 2009 16:00:58 -0700 (PDT) In-Reply-To: <4AA19ACA.3020401@boekhoff.info> References: <4AA10254.4050509@boekhoff.info> <4AA1355E.2040000@boekhoff.info> <4AA13DD8.80404@boekhoff.info> <4AA13F83.1080308@boekhoff.info> <4AA14090.6010903@boekhoff.info> <4AA19ACA.3020401@boekhoff.info> Date: Sat, 5 Sep 2009 00:00:58 +0100 Message-ID: Subject: Re: Creating Multinomial Random numbers with Mahout From: Sean Owen To: mahout-user@lucene.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Well, sounds like you are loading classes that need Hadoop, and you have not put Hadoop in your classpath. These questions aren't particularly specific to Mahout -- I think you'd benefit from learning a bit more about how Java works first. It'll get you past a lot of small issues like this. On Fri, Sep 4, 2009 at 11:55 PM, Sven Boekhoff wrote: > It does nor work. > It throws the error: > > Exception in thread "main" java.lang.NoClassDefFoundError: > org/apache/hadoop/io/Writable > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.ClassLoader.defineClass1(Native M= ethod) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.ClassLoader.defineClass(ClassLoad= er.java:621) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.net.URLClassLoader.defineClass(URLClas= sLoader.java:260) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.net.URLClassLoader.access$000(URLClass= Loader.java:56) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.net.URLClassLoader$1.run(URLClassLoade= r.java:195) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.security.AccessController.doPrivileged= (Native Method) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.net.URLClassLoader.findClass(URLClassL= oader.java:188) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.ClassLoader.loadClass(ClassLoader= .java:307) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.misc.Launcher$AppClassLoader.loadClass(= Launcher.java:301) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.ClassLoader.loadClass(ClassLoader= .java:252) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.ClassLoader.loadClassInternal(Cla= ssLoader.java:320) > Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.io.Writabl= e > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.net.URLClassLoader$1.run(URLClassLoade= r.java:200) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.security.AccessController.doPrivileged= (Native Method) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.net.URLClassLoader.findClass(URLClassL= oader.java:188) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.ClassLoader.loadClass(ClassLoader= .java:307) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at sun.misc.Launcher$AppClassLoader.loadClass(= Launcher.java:301) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.ClassLoader.loadClass(ClassLoader= .java:252) > =C2=A0 =C2=A0 =C2=A0 =C2=A0at java.lang.ClassLoader.loadClassInternal(Cla= ssLoader.java:320) > =C2=A0 =C2=A0 =C2=A0 =C2=A0... 12 more > Could not find the main class: Main. =C2=A0Program will exit. > > Do I need the hadoop library? This is not written in the requirements,... > > > Sean Owen wrote: >> >> I think you probably want to study basic Java first then or you're >> going to run into a lot more confusion. >> >> Vector probabilities =3D new SparseVector(); >> >> is what you want. Interfaces and instantiating objects are the very >> basics of Java. >> >> On Fri, Sep 4, 2009 at 5:30 PM, Sven Boekhoff wrote: >>> >>> I never worked with interfaces. >>> And i also don't know what "instantiate an implementation" means. >>> How does it look like? >>> >>> Sean Owen wrote: >>>> >>>> Yes, Vector is an interface! You need to instantiate an implementation >>>> like DenseVector. >>>> >>>> On Fri, Sep 4, 2009 at 5:25 PM, Sven Boekhoff wrot= e: >>>>> >>>>> But i cant create an Vector object: >>>>> >>>>> Vector probabilities =3D new Vector(); >>>>> >>>>> gives an error. >>>>> >