I'm trying to compile a mixed java-scala code using intelliJ 14.1.4
but it keeps giving me this error:
Error Compiling SBT component 'compiler-interface-2.9.2-52.0'
I have tried to downgrade my scala-compiler version but this didn't help.
I'm trying to compile a mixed java-scala code using intelliJ 14.1.4
but it keeps giving me this error:
Error Compiling SBT component 'compiler-interface-2.9.2-52.0'
I have tried to downgrade my scala-compiler version but this didn't help.
I had the same issue:
Error Compiling the SBT component 'compiler-interface-2.11.8-53.0'
I was running Java 9,jdk-9.0.4, I fixed this by going back to Java 8, jdk1.8.0_161
this confuse me a lot
in idea you have two jdk setup
one is
another is
you need to set this two both to jdk1.8 or will always be conflict with your scala.
To add to Amy's and other answers, there are three places where JDK is involved. The first two are in the Project Settings, the third is Settings -> Build, Execution, Deployment -> Compiler -> Scala Compiler -> Scala Compile Server (if enabled). If this problem arises, check these three are the same.
Make sure you have the JDK-1.8 set in the following places.
Project Settings -> Project -> Project SDK
Project Settings -> Modules -> Dependencies -> Module SDK
Add/Select JDK-1.8 in
Project Settings -> SDKs
Make sure you have the JDK-1.8 set in the following places. Project Settings -> Project -> Project SDK Project Settings -> Modules -> Dependencies -> Module SDK Add/Select JDK-1.8 in
Project Settings -> SDKs
The first two are in the Project Settings, the third is Settings -> Build, Execution, Deployment -> Compiler -> Scala Compiler -> Scala Compile Server (if enabled). If this problem arises, check these three are the same.
Make Sure that Java versions are same every where,
Don't believe to Intellij's compiler. Prefer compiling them in a console.
Try to re-import the project to Intellij.
Solved.
The issue was due to 2 different dependencies, which imported 2 different scala versions, and then scala 2.11 was compiled with scala 2.9 which led to the error.
maven dependencyManagement solved it for me
This problem occurs due to incompatibility in versions of the libraries used. The solution is to ensure that java version, scala version, any other library version are all compatible with each other. mvnrepository can be used for checking.
Also, please make sure you are using compatible Scala and Jdk version. like - JDK-Scala Version compatibility table
Please refer - https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html
I met the same error when I run the old project https://github.com/dpp/simply_lift
it was from 2010.. I must revert my java to 1.7 and update the Scala version from 2.11.6 to 2.11.12 , add it to Project Settings-> Modules
Then I can start the project ...
File --> Invalidate caches/restart was also needed for me in addition to fixing libraries.
© 2022 - 2024 — McMap. All rights reserved.