I wrote a spark program with scala, but when I use spark-submit to submit my project, I met java.lang.ClassNotFoundException.
my.sbt file:
name:="Spark Project" version:="1.0" scalaVersion:="2.10.5" libraryDependencies+="org.apache.spark" %% "spark-core" % "1.3.0"
My name .scala is SparkProject.scala, and in it the name of the object is also SparkProject.
import org.apache.spark.SparkContext import org.apache.spark.SparkContext._ import org.apache.spark.SparkConf object SparkProject { def main(args: Array[String]) { val logFile = "YOUR_SPARK_HOME/README.md"
My command to submit the project:
spark-submit --class "SparkProject" --master local[12] target/scala-2.10/spark-project_2.10-1.0.jar
Does anyone know how to solve this? Finally, what makes me embarrassed when I try to give an example here [ http://spark.apache.org/docs/latest/quick-start.htmlโ ,it works well. But when I create a new project and submit it, it goes wrong. Any help would be greatly appreciated.
zhang source share