scala complier error

Answered

Error:scalac: Error: Could not initialize class org.jetbrains.jps.incremental.scala.data.HydraData$
java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.jps.incremental.scala.data.HydraData$
at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl$.getHydraVersion$1(CompilerFactoryImpl.scala:112)
at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl$.getOrCompileInterfaceJar(CompilerFactoryImpl.scala:117)
at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.$anonfun$getScalac$1(CompilerFactoryImpl.scala:49)
at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl$$Lambda$34/1456490682.apply(Unknown Source)
at scala.Option.map(Option.scala:146)
at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.getScalac(CompilerFactoryImpl.scala:47)
at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.createCompiler(CompilerFactoryImpl.scala:25)
at org.jetbrains.jps.incremental.scala.local.CachingFactory.$anonfun$createCompiler$3(CachingFactory.scala:24)
at org.jetbrains.jps.incremental.scala.local.CachingFactory$$Lambda$21/996642728.apply(Unknown Source)
at org.jetbrains.jps.incremental.scala.local.Cache.$anonfun$getOrUpdate$2(Cache.scala:20)
at org.jetbrains.jps.incremental.scala.local.Cache$$Lambda$23/154590974.apply(Unknown Source)
at scala.Option.getOrElse(Option.scala:121)
at org.jetbrains.jps.incremental.scala.local.Cache.getOrUpdate(Cache.scala:19)
at org.jetbrains.jps.incremental.scala.local.CachingFactory.createCompiler(CachingFactory.scala:24)
at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:22)
at org.jetbrains.jps.incremental.scala.remote.Main$.make(Main.scala:68)
at org.jetbrains.jps.incremental.scala.remote.Main$.nailMain(Main.scala:25)
at org.jetbrains.jps.incremental.scala.remote.Main.nailMain(Main.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.martiansoftware.nailgun.NGSession.run(NGSession.java:319)

0
6 comments

Try deleting IDE caches and plugins directories, then complete re-install from https://www.jetbrains.com/idea/download and install the Scala plugin.

0
Avatar
Permanently deleted user

It doesn't work . Which progress is wrong, jdk 1.8 + scala 2.12.4 

0
Avatar
Permanently deleted user

I deleted IDE caches and plugins, and changed my idea to previous version (2017.3 -> 2017.1) , it works.

thanks a lot, Andrey Dernov

0
Avatar
Permanently deleted user

I am using latest version of Idea (after deleting all logs and caches as indicated by Andrey), installed corresponding scala plugin, however, everytime I compiled the source code, only class files of java code can be generated rather than scala code, and raises the same erorr.

 

Can anyone help ?

0

What Scala version do you use? Do you use external compiler server in Settings(Preferences on Mac) | Build, Execution, Deployment | Compiler | Scala Compiler | Scala Compile Server settings? Try specifying different JDK version for the JVM SDK option in that settings.

0
Avatar
Permanently deleted user

FYI I had a similar issue. I managed to fix the build with the following steps 

- Go to Settings(Preferences on Mac) | Build, Execution, Deployment | Compiler | Scala Compiler | Scala Compile Server settings

- Select the related sbt build

- Remove any sbt options from the "Additional compiler options" 

Scala plugin version v2018.3.779 / IntelliJ Ultimate 2018.3 on Mac OS

 

0

Please sign in to leave a comment.