spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wanda Hawk <>
Subject SparkKMeans.scala from examples will show: NoClassDefFoundError: breeze/linalg/Vector
Date Tue, 01 Jul 2014 11:39:57 GMT

I have installed spark-1.0.0 with scala2.10.3. I have built spark with "sbt/sbt assembly"
and added "/home/wanda/spark-1.0.0/assembly/target/scala-2.10/spark-assembly-1.0.0-hadoop1.0.4.jar"
to my CLASSPATH variable. 
Then I went here "../spark-1.0.0/examples/src/main/scala/org/apache/spark/examples" created
a new directory "classes" and compiled SparkKMeans.scala with "scalac -d classes/ SparkKMeans.scala" 
Then I navigated to "classes" (I commented this line in the scala file : package org.apache.spark.examples
) and tried to run it with "java -cp . SparkKMeans" and I get the following error:
"Exception in thread "main" java.lang.NoClassDefFoundError: breeze/linalg/Vector
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(
        at java.lang.Class.getMethod0(
        at java.lang.Class.getMethod(
        at sun.launcher.LauncherHelper.getMainMethod(
        at sun.launcher.LauncherHelper.checkAndLoadMain(
Caused by: java.lang.ClassNotFoundException: breeze.linalg.Vector
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        ... 6 more
The jar under "/home/wanda/spark-1.0.0/assembly/target/scala-2.10/spark-assembly-1.0.0-hadoop1.0.4.jar"
contains the breeze/linalg/Vector* path, I even tried to unpack it and put it in CLASSPATH
to it does not seem to pick it up

I am currently running java 1.8
"java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)"

What I am doing wrong ?
View raw message