class java.lang.RuntimeException/error reading Scala signature of package.class: Scala signature pac

在用scala连接spark时,出现错误:

scalac: error while loading package, class file 'C:\Users\asus\.ivy2\cache\org.scala-lang\scala-library\jars\scala-library-2.13.7.jar(scala/reflect/package.class)' is broken
(class java.lang.RuntimeException/error reading Scala signature of package.class: Scala signature package has wrong version
expected: 5.0
found: 5.2 in package.class)

class java.lang.RuntimeException/error reading Scala signature of package.class: Scala signature pac

 

 是因为版本冲突的问题,编译器添加scala的sdk版本与pom文件的版本一致

class java.lang.RuntimeException/error reading Scala signature of package.class: Scala signature pac

 

打开File>>Project Structure>>Global Librarier 添加和pom文件一致的版本即可

class java.lang.RuntimeException/error reading Scala signature of package.class: Scala signature pac

 

 运行成功

class java.lang.RuntimeException/error reading Scala signature of package.class: Scala signature pac

 

 最后,,用的spark版本是3.0

上一篇:234、回文链表 | JS


下一篇:微信公众号交互代码的一个问题