Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala Compiliation error with intellij

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 down grade my scala-compiler version but this didn't helped.

any help would be appreciated.

like image 205
vlady Avatar asked Aug 06 '15 09:08

vlady


People also ask

Does IntelliJ work with Scala?

To start working with Scala in IntelliJ IDEA you need to download and enable the Scala plugin. If you run IntelliJ IDEA for the first time, you can install the Scala plugin when IntelliJ IDEA suggests downloading featured plugins. Otherwise, you can use the Settings | Plugins page for the installation.

How do I enable Scala in IntelliJ?

Open IntelliJ IDEA, go to File Menu --> Plugins --> [ Or directly press Ctrl+Alt+S ] Click on "Browse repositories" button and enter "Scala". Select Scala plugin to install it.

How do I select Scala version in IntelliJ?

Press Ctrl+Alt+S to open Settings/Preferences dialog. From the options on the left, select Build, Execution, Deployment | Compiler | Scala | Scala Compiler Server.

How do I add Scala framework support in IntelliJ?

To add Scala support to existing module:Right-click the module in Project View, choose “Add Framework Support…” Check “Scala” in technologies list (unavailable if module has Scala facet attached) Provide a path to Scala installation (if not detected)


2 Answers

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

like image 199
Andre Odendaal Avatar answered Oct 04 '22 04:10

Andre Odendaal


this confuse me a lot

in idea you have two jdk setup

one is

enter image description here

another is

enter image description here

you need to set this two both to jdk1.8 or will always be conflict with your scala.

like image 40
Amy Avatar answered Oct 04 '22 02:10

Amy