Unable to copile scala anymore (from 2016.3 to 2017.1 )

Hello,

 

I tried to update from 2016.3 to the latest 2017.1 yesterday.

From then I got the following error whenever I try to open one my scala projects.

Error:scalac: Error: org/jetbrains/jps/incremental/ModuleLevelBuilder$ExitCode : Unsupported major.minor version 52.0
java.lang.UnsupportedClassVersionError: org/jetbrains/jps/incremental/ModuleLevelBuilder$ExitCode : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:30)
    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:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.martiansoftware.nailgun.NGSession.run(NGSession.java:319)

 

 

I guess it has something to do with java version and scala but I can't figure it out

10 comments
Comment actions Permalink
Official comment

Please make sure that Settings / Languages / Scala Compiler Server / JVM uses Java 8 (you may need to restart the compiler server after changing the JVM).

 

This JVM is used solely as a runtime for the compile server, you can still use any Java version in your project.

Comment actions Permalink

Switch to Java 8.

0
Comment actions Permalink

my running java (on my dev machine) is java 8; plus intellij include a bundled runtime if remember correctly (linux version).

my target java version isn't going to chnage because of the IDE I use...

0
Comment actions Permalink

Thanks for the report, I've submitted it to the issue tracker. Please star/vote the issue to receive notifications: https://youtrack.jetbrains.com/issue/SCL-11676. See https://intellij-support.jetbrains.com/hc/articles/207241135 if you are not familiar with YouTrack.

0
Comment actions Permalink

I am facing the same issue. We use java 7 for our build. Does it mean with intellij 2017.1 can't we have java 1.7? 

0
Comment actions Permalink

What if I cannot switch to java 8?

0
Comment actions Permalink

Option to choose JDK for Scala Compile Server is returned in 2017.2. Currently it is available in nightly builds only:
https://confluence.jetbrains.com/display/SCA/Scala+Plugin+Nightly

 

0
Comment actions Permalink

Hi, My situation is similar to Pihentagy's where my PROD environment is Java 1.7 with scala 2.10.5. I get this error if I use java 1.7 in my Mavanproject, what are my options?

0
Comment actions Permalink

In IDEA 2017.2 try to change Scala Compile Server SDK to 1.7. Also, you may try to update to scala 2.10.6, I think some compatibility issues with 1.8 was fixed there.

0
Comment actions Permalink

Thanks a lot Nikolay - I did and it worked!

0

Please sign in to leave a comment.