ClassNotFoundException scala.runtime.LambdaDeserialize when spark-submit

前端 未结 4 1602
南笙
南笙 2020-12-19 00:07

I follow the Scala tutorial on https://spark.apache.org/docs/2.1.0/quick-start.html

My scala file

/* SimpleApp.scala */
import org.apache.spark.Spark         


        
4条回答
  •  無奈伤痛
    2020-12-19 00:52

    Following is the build.sbt entries for the latest Spark 2.4.1 release sample shown in Spark/Scala online guide:

    name := "SimpleApp" 
    version := "1.0"
    scalaVersion := "2.12.8"
    libraryDependencies += "org.apache.spark"  %% "spark-sql" % "2.4.1"
    

    Though everything works fine inside IntelliJ IDE, the application still fails with the following exception,

    Caused by: java.lang.NoClassDefFoundError: scala/runtime/LambdaDeserialize
    

    after creating the package with 'sbt package' command and running the spark-submit from the command line as the following;

    spark-submit -v --class SimpleApp --master local[*] target\scala-2.12\simpleapp_2.12-1.0.jar
    

提交回复
热议问题