Scalac: Error: CharRef object in intelliJ 14

I can compile the code from the terminal using the mvn compile command . But when I compile the code with intellij 14 I got the following error:

Error:scalac: Error: object CharRef does not have a member create
scala.reflect.internal.FatalError: object CharRef does not have a member create
    at scala.reflect.internal.Definitions$DefinitionsClass.scala$reflect$internal$Definitions$DefinitionsClass$$fatalMissingSymbol(Definitions.scala:1179)
    at ...

      

What could be the reason?

+3


source to share


4 answers


I fixed this by running File -> Invalid Cache / Reload .



+2


source


I had a similar problem while trying to work with some Scala examples for Spark.

Apparently the problem I was experiencing was caused by the incompatibility of the IntelliJ Scala project (3.11.7) and Spark Maven dependencies (2.10):



<dependency> <!-- Spark dependency -->
  <groupId>org.apache.spark</groupId>
  <artifactId>spark-core_2.10</artifactId>
  <version>1.4.1</version>
  <scope>provided</scope>
</dependency>

      

Once I changed spark-core_2.10 to spark-core_2.11 and rebuilt the project, everything started working as expected.

+1


source


My project depends on Scala 2.10, but the Scala SDK in IDEA is 2.11. I also changed the SDK to 2.10 and the error went away.

0


source


My version is IntelliJ IDEA 2016.1.3 and has the same problem. My solution is to change scala -sdk 2.12.1 to use version 2.10.4, it can be fixed. Help him help the guys.

0


source







All Articles