spark idea java.lang.NoClassDefFoundError

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FSDataInputStream
	at org.apache.spark.SparkConf.loadFromSystemProperties(SparkConf.scala:73)
	at org.apache.spark.SparkConf.(SparkConf.scala:68)
	at org.apache.spark.SparkConf.(SparkConf.scala:55)

也可能是

Exception in thread "main" java.lang.NoClassDefFoundError: scala/Cloneable 
at java.lang.ClassLoader.defineClass1(Native Method) 
at java.lang.ClassLoader.defineClass(ClassLoader.java

都是类似的报错,这个主要是maven依赖的scope设置不对 ,注释掉provided

    
      org.apache.spark
      spark-core_${scala.binary.version}
      ${project.version}
     
    

一般是再idea 运行spark 的 mainclass 报错

你可能感兴趣的:(spark idea java.lang.NoClassDefFoundError)