Add this jar <http://mvnrepository.com/artifact/org.apache.commons/commons-math3/3.3> while creating the sparkContext.
sc.addJar("/path/to/commons-math3-3.3.jar") And make sure it is shipped and available in the environment tab (4040) Thanks Best Regards On Mon, Nov 17, 2014 at 1:54 PM, Ritesh Kumar Singh < riteshoneinamill...@gmail.com> wrote: > My sbt file for the project includes this: > > libraryDependencies ++= Seq( > "org.apache.spark" %% "spark-core" % "1.1.0", > "org.apache.spark" %% "spark-mllib" % "1.1.0", > "org.apache.commons" % "commons-math3" % "3.3" > ) > ============================================================= > > Still I am getting this error: > > >java.lang.NoClassDefFoundError: > org/apache/commons/math3/random/RandomGenerator > > ============================================================= > > The jar at location: ~/.m2/repository/org/apache/commons/commons-math3/3.3 > contains the random generator class: > > $ jar tvf commons-math3-3.3.jar | grep RandomGenerator > >org/apache/commons/math3/random/RandomGenerator.class > >org/apache/commons/math3/random/UniformRandomGenerator.class > >org/apache/commons/math3/random/SynchronizedRandomGenerator.class > >org/apache/commons/math3/random/AbstractRandomGenerator.class > >org/apache/commons/math3/random/RandomGeneratorFactory$1.class > >org/apache/commons/math3/random/RandomGeneratorFactory.class > >org/apache/commons/math3/random/StableRandomGenerator.class > >org/apache/commons/math3/random/NormalizedRandomGenerator.class > >org/apache/commons/math3/random/JDKRandomGenerator.class > >org/apache/commons/math3/random/GaussianRandomGenerator.class > > > Please help >