new SparkContext()发生错误java.lang.NoSuchMethodError: scala.Predef

参考:https://blog.csdn.net/weixin_40137479/article/details/80320324

 

new SparkContext(conf)发生错误:

Exception in thread "main" java.lang.NoSuchMethodError: scala.Predef$.refArrayOps([Ljava/lang/Object;)Lscala/collection/mutable/ArrayOps;
at org.apache.spark.util.Utils$.getCallSite(Utils.scala:1306)
at org.apache.spark.SparkContext.<init>(SparkContext.scala:82)
at makeRDDDemo$.main(makeRDDDemo.scala:9)
at makeRDDDemo.main(makeRDDDemo.scala)

 

解决办法:将Scala2.11.x更换为Scala2.10.x

File –> Other Settings –> Default Project Structure –> Global Library

猜你喜欢

转载自www.cnblogs.com/144823836yj/p/10923581.html