[Solved] class java.lang.RuntimeException/error reading Scala signature of package.class: Scala signature package has wrong version

An error occurred while connecting spark with Scala:

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)

Because of the version conflict, the SDK version of scala added by the compiler is consistent with the version of POM file

Open file >> Project Structure >> Global librarier can add a version consistent with the POM file

Run successfully

Finally, the spark version used is 3.0

Similar Posts: