Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Getting scalac: Error: Error compiling the sbt component 'compiler-interface-2.11.8-62.0' during running scala spark program

Ask Question ThisBuild / scalaVersion := "2.11.8" // https://mvnrepository.com/artifact/org.apache.spark/spark-core ThisBuild / libraryDependencies += "org.apache.spark" %% "spark-core" % "2.4.8" lazy val root = (project in file(".")) .settings( name := "Spark_Practice"

Error:

scalac: Error: Error compiling the sbt component 'compiler-interface-2.11.8-62.0' sbt.internal.inc.CompileFailed: Error compiling the sbt component 'compiler-interface-2.11.8-62.0' at sbt.internal.inc.AnalyzingCompiler$.handleCompilationError$1(AnalyzingCompiler.scala:436) sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$5(AnalyzingCompiler.scala:453) sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$5$adapted(AnalyzingCompiler.scala:448) at sbt.io.IO$.withTemporaryDirectory(IO.scala:490) at sbt.io.IO$.withTemporaryDirectory(IO.scala:500) at sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$2(AnalyzingCompiler.scala:448) sbt.internal.inc.AnalyzingCompiler$.$anonfun$compileSources$2$adapted(AnalyzingCompiler.scala:440) at sbt.io.IO$.withTemporaryDirectory(IO.scala:490) at sbt.io.IO$.withTemporaryDirectory(IO.scala:500) at sbt.internal.inc.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:440) org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl$.org$jetbrains$jps$incremental$scala$local$CompilerFactoryImpl$$getOrCompileInterfaceJar(CompilerFactoryImpl.scala:163) org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.$anonfun$getScalac$1(CompilerFactoryImpl.scala:61) at scala.Option.map(Option.scala:242) at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.getScalac(CompilerFactoryImpl.scala:54) org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.createCompiler(CompilerFactoryImpl.scala:23) org.jetbrains.jps.incremental.scala.local.CachingFactory.$anonfun$createCompiler$3(CachingFactory.scala:24) org.jetbrains.jps.incremental.scala.local.Cache.$anonfun$getOrUpdate$2(Cache.scala:20) at scala.Option.getOrElse(Option.scala:201) at org.jetbrains.jps.incremental.scala.local.Cache.getOrUpdate(Cache.scala:19) org.jetbrains.jps.incremental.scala.local.CachingFactory.createCompiler(CachingFactory.scala:24) org.jetbrains.jps.incremental.scala.local.LocalServer.doCompile(LocalServer.scala:43) org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:30) org.jetbrains.jps.incremental.scala.remote.Main$.compileLogic(Main.scala:209) org.jetbrains.jps.incremental.scala.remote.Main$.$anonfun$handleCommand$1(Main.scala:192) org.jetbrains.jps.incremental.scala.remote.Main$.decorated$1(Main.scala:182) org.jetbrains.jps.incremental.scala.remote.Main$.handleCommand(Main.scala:189) org.jetbrains.jps.incremental.scala.remote.Main$.serverLogic(Main.scala:165) org.jetbrains.jps.incremental.scala.remote.Main$.nailMain(Main.scala:105) org.jetbrains.jps.incremental.scala.remote.Main.nailMain(Main.scala) java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:577) at com.facebook.nailgun.NGSession.runImpl(NGSession.java:312) at com.facebook.nailgun.NGSession.run(NGSession.java:198)

Can't reproduce. Scala 2.11.8 seems to work with Spark 2.4.8 scastie.scala-lang.org/0Qk3wTpnQh2vytlLiFDlFg (tab "Build Settings") scastie.scala-lang.org/8jfGPzmySzWh54fB7kmX6g Dmytro Mitin Feb 5 at 6:53 How do you build your project when you get the error? Do you open it in IDE or run sbt clean compile ? Try the latter. Dmytro Mitin Feb 5 at 6:58 Now im getting scalac: Cannot connect to compile server at localhost/127.0.0.1:3200 (Connection refused: no further information) [SBT_New_SCALA] Trying to compile without it Bhavesh Sonawane Feb 5 at 8:29

I faced with the same error. If you use Intellij Idea, you can try to solve this issue by changing the JDK to 1.8.

  • Open the Settings
  • Find 'Scala Compiler Server' under the Build,Execution,Deployment > Compiler > Scala Compiler
  • Change the JDK to 1.8
  • Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question . Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers .