The commons-math3 dependency should have brought down the following jar:
~/.m2/repository/org/apache/commons/commons-math3/3.1.1/commons-math3-3.1.1.jar

$ jar tvf commons-math3-3.1.1.jar | grep RandomGenerator
   200 Wed Jan 09 17:13:38 UTC 2013
org/apache/commons/math3/random/NormalizedRandomGenerator.class
   936 Wed Jan 09 17:13:38 UTC 2013
org/apache/commons/math3/random/UniformRandomGenerator.class
  1697 Wed Jan 09 17:13:38 UTC 2013
org/apache/commons/math3/random/SynchronizedRandomGenerator.class
   855 Wed Jan 09 17:13:38 UTC 2013
org/apache/commons/math3/random/JDKRandomGenerator.class
  2394 Wed Jan 09 17:13:38 UTC 2013
org/apache/commons/math3/random/StableRandomGenerator.class
  2399 Wed Jan 09 17:13:38 UTC 2013
org/apache/commons/math3/random/AbstractRandomGenerator.class
   756 Wed Jan 09 17:13:38 UTC 2013
org/apache/commons/math3/random/GaussianRandomGenerator.class
   395 Wed Jan 09 17:13:36 UTC 2013
org/apache/commons/math3/random/RandomGenerator.class

If you put commons-math3-3.1.1.jar in your classpath, the error should go
away.

Cheers

On Sat, Oct 4, 2014 at 2:41 PM, anny9699 <anny9...@gmail.com> wrote:

> Hi Ted,
>
> I tried including
>     <dependency>
>       <groupId>org.apache.commons</groupId>
>       <artifactId>commons-math3</artifactId>
>       <version>3.3</version>
>     </dependency>
> in my pom file and adding this jar to my classpath. However this error
> still appears as
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/commons/math3/random/RandomGenerator
> at
> breeze.stats.distributions.Bernoulli$.$lessinit$greater$default$2(Bernoulli.scala:30)
> So seems this jar should be included in breeze when then built the
> package, and simply adding it to dependency doesn't help.
>
> Thanks a lot!
> Anny
>
> On Sat, Oct 4, 2014 at 2:32 PM, Ted Yu [via Apache Spark User List] <[hidden
> email] <http://user/SendEmail.jtp?type=node&node=15755&i=0>> wrote:
>
>> breeze jar doesn't contain RandomGenerator class.
>>
>> Have you tried with commons-math3 3.1.1 in your pom.xml ?
>>
>> Let us know if you still encounter problems.
>>
>> Cheers
>>
>> On Sat, Oct 4, 2014 at 2:11 PM, 陈韵竹 <[hidden email]
>> <http://user/SendEmail.jtp?type=node&node=15754&i=0>> wrote:
>>
>>> Hi Ted,
>>>
>>> I did include explicitly breeze in my pom.xml
>>>
>>>     <dependency>
>>>
>>>       <groupId>org.scalanlp</groupId>
>>>
>>>       <artifactId>breeze_${scala.binary.version}</artifactId>
>>>
>>>       <version>0.9</version>
>>>
>>>     </dependency>
>>>
>>> But this error message still appears.
>>>
>>>
>>> Thanks!
>>>
>>> On Sat, Oct 4, 2014 at 2:03 PM, Ted Yu <[hidden email]
>>> <http://user/SendEmail.jtp?type=node&node=15754&i=1>> wrote:
>>>
>>>> See the last comment in that thread from Xiangrui:
>>>>
>>>> bq. include breeze in the dependency set of your project. Do not rely
>>>> on transitive dependencies
>>>>
>>>> Cheers
>>>>
>>>> On Sat, Oct 4, 2014 at 1:48 PM, 陈韵竹 <[hidden email]
>>>> <http://user/SendEmail.jtp?type=node&node=15754&i=2>> wrote:
>>>>
>>>>> Hi Ted,
>>>>>
>>>>> So according to previous posts, the problem should be solved by
>>>>> changing the spark-1.1.0 core pom file?
>>>>>
>>>>> Thanks!
>>>>>
>>>>> On Sat, Oct 4, 2014 at 1:06 PM, Ted Yu <[hidden email]
>>>>> <http://user/SendEmail.jtp?type=node&node=15754&i=3>> wrote:
>>>>>
>>>>>> Cycling bits:
>>>>>> http://search-hadoop.com/m/JW1q5UX9S1/breeze+spark&subj=Build+error+when+using+spark+with+breeze
>>>>>>
>>>>>> On Sat, Oct 4, 2014 at 12:59 PM, anny9699 <[hidden email]
>>>>>> <http://user/SendEmail.jtp?type=node&node=15754&i=4>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I use the breeze.stats.distributions.Bernoulli in my code, however
>>>>>>> met this
>>>>>>> problem
>>>>>>> java.lang.NoClassDefFoundError:
>>>>>>> org/apache/commons/math3/random/RandomGenerator
>>>>>>>
>>>>>>> I read the posts about this problem before, and if I added
>>>>>>>     <dependency>
>>>>>>>       <groupId>org.apache.commons</groupId>
>>>>>>>       <artifactId>commons-math3</artifactId>
>>>>>>>       <version>3.3</version>
>>>>>>>       <scope>runtime</scope>
>>>>>>>     </dependency>
>>>>>>> to my pom.xml, more serious issues will appear. The breeze
>>>>>>> dependency is
>>>>>>> already in my pom.xml. I am using Spark-1.1.0. Seems I didn't meet
>>>>>>> this
>>>>>>> issue when I was using Spark-1.0.0. Does anyone have some
>>>>>>> suggestions?
>>>>>>>
>>>>>>> Thanks a lot!
>>>>>>> Anny
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://apache-spark-user-list.1001560.n3.nabble.com/org-apache-commons-math3-random-RandomGenerator-issue-tp15748.html
>>>>>>> Sent from the Apache Spark User List mailing list archive at
>>>>>>> Nabble.com.
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: [hidden email]
>>>>>>> <http://user/SendEmail.jtp?type=node&node=15754&i=5>
>>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>> <http://user/SendEmail.jtp?type=node&node=15754&i=6>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://apache-spark-user-list.1001560.n3.nabble.com/org-apache-commons-math3-random-RandomGenerator-issue-tp15748p15754.html
>>  To unsubscribe from org/apache/commons/math3/random/RandomGenerator
>> issue, click here.
>> NAML
>> <http://apache-spark-user-list.1001560.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
> ------------------------------
> View this message in context: Re:
> org/apache/commons/math3/random/RandomGenerator issue
> <http://apache-spark-user-list.1001560.n3.nabble.com/org-apache-commons-math3-random-RandomGenerator-issue-tp15748p15755.html>
>
> Sent from the Apache Spark User List mailing list archive
> <http://apache-spark-user-list.1001560.n3.nabble.com/> at Nabble.com.
>

Reply via email to