Spark启动错误Exception in thread “main” java.lang.NoSuchMethodError: scala.collection.immutable.HashSet$

 

1   错误

[error] (run-main-0) java.lang.NoSuchMethodError: scala.collection.immutable.HashSet$.empty()Lscala/collection/immutable/HashSet;
java.lang.NoSuchMethodError: scala.collection.immutable.HashSet$.empty()Lscala/collection/immutable/HashSet;
    at akka.actor.ActorCell$.(ActorCell.scala:305)
    at akka.actor.ActorCell$.(ActorCell.scala)
    at akka.actor.RootActorPath.$div(ActorPath.scala:152)
    at akka.actor.LocalActorRefProvider.(ActorRefProvider.scala:465)
    at akka.remote.RemoteActorRefProvider.(RemoteActorRefProvider.scala:124)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at akka.actor.ReflectiveDynamicAccess$$anonfun$createInstanceFor$2.apply(DynamicAccess.scala:78)
    at scala.util.Try$.apply(Try.scala:191)

 

2 解决方案

  Scala 的版本与 Spark版本不匹配

  博主用的是 Spark 1.5.1  之前装的 Scala 2.11.0  ,运行示例SparkPi出现上述错误。

  改用Scala 2.10.6 ,问题解决了。

 

你可能感兴趣的:(Spark,错误集)