compile error in idea 12 with scala 2.10.2

Configured scala 2.10.2 in the latest intellij 12 and can compile sample scala from dos prompt on win 7.
But when I build with internal compiler in intellij it throws error:

Can anyone give a link to different icon for scala code?  I see cogwheel, stairs, cogwheel+stairs and dont' know what caused it.

scala: error while loading <root>, error in opening zip file
Error: object scala.runtime in compiler mirror not found.
scala.reflect.internal.MissingRequirementError: object scala.runtime in compiler mirror not found.
    at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:16)
    at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:17)
    at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:48)
    at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:40)
    at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:61)
    at scala.reflect.internal.Mirrors$RootsBase.getPackage(Mirrors.scala:172)
    at scala.reflect.internal.Mirrors$RootsBase.getRequiredPackage(Mirrors.scala:175)
    at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackage$lzycompute(Definitions.scala:181)
    at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackage(Definitions.scala:181)
    at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackageClass$lzycompute(Definitions.scala:182)
    at scala.reflect.internal.Definitions$DefinitionsClass.RuntimePackageClass(Definitions.scala:182)
    at scala.reflect.internal.Definitions$DefinitionsClass.AnnotationDefaultAttr$lzycompute(Definitions.scala:1015)
    at scala.reflect.internal.Definitions$DefinitionsClass.AnnotationDefaultAttr(Definitions.scala:1014)
    at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreClasses$lzycompute(Definitions.scala:1144)
    at scala.reflect.internal.Definitions$DefinitionsClass.syntheticCoreClasses(Definitions.scala:1143)
    at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode$lzycompute(Definitions.scala:1187)
    at scala.reflect.internal.Definitions$DefinitionsClass.symbolsNotPresentInBytecode(Definitions.scala:1187)
    at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1252)
    at scala.tools.nsc.Global$Run.<init>(Global.scala:1290)
    at xsbt.CachedCompiler0$$anon$2.<init>(CompilerInterface.scala:104)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:104)
    at xsbt.CachedCompiler0.run(CompilerInterface.scala:89)
    at xsbt.CompilerInterface.run(CompilerInterface.scala:27)
    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:601)
    at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:74)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:36)
    at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:30)
    at sbt.compiler.AggressiveCompile$$anonfun$8$$anonfun$compileScala$1$1$$anonfun$apply$3$$anonfun$apply$1.apply$mcV$sp(AggressiveCompile.scala:77)
    at sbt.compiler.AggressiveCompile$$anonfun$8$$anonfun$compileScala$1$1$$anonfun$apply$3$$anonfun$apply$1.apply(AggressiveCompile.scala:77)
    at sbt.compiler.AggressiveCompile$$anonfun$8$$anonfun$compileScala$1$1$$anonfun$apply$3$$anonfun$apply$1.apply(AggressiveCompile.scala:77)
    at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:137)
    at sbt.compiler.AggressiveCompile$$anonfun$8$$anonfun$compileScala$1$1$$anonfun$apply$3.apply(AggressiveCompile.scala:76)
    at sbt.compiler.AggressiveCompile$$anonfun$8$$anonfun$compileScala$1$1$$anonfun$apply$3.apply(AggressiveCompile.scala:73)
    at scala.Option.foreach(Option.scala:236)
    at sbt.compiler.AggressiveCompile$$anonfun$8$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:73)
    at sbt.compiler.AggressiveCompile$$anonfun$8$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:73)
    at scala.Option.foreach(Option.scala:236)
    at sbt.compiler.AggressiveCompile$$anonfun$8.compileScala$1(AggressiveCompile.scala:73)
    at sbt.compiler.AggressiveCompile$$anonfun$8.apply(AggressiveCompile.scala:118)
    at sbt.compiler.AggressiveCompile$$anonfun$8.apply(AggressiveCompile.scala:61)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:24)
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:22)
    at sbt.inc.Incremental$.cycle(Incremental.scala:46)
    at sbt.inc.Incremental$.compile(Incremental.scala:29)
    at sbt.inc.IncrementalCompile$.apply(Compile.scala:20)
    at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:128)
    at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:44)
    at org.jetbrains.jps.incremental.scala.local.CompilerImpl.compile(CompilerImpl.scala:63)
    at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:29)
    at org.jetbrains.jps.incremental.scala.ScalaBuilder$$anonfun$5$$anonfun$apply$3$$anonfun$apply$4.apply(ScalaBuilder.scala:118)
    at org.jetbrains.jps.incremental.scala.ScalaBuilder$$anonfun$5$$anonfun$apply$3$$anonfun$apply$4.apply(ScalaBuilder.scala:100)
    at scala.util.Either$RightProjection.map(Either.scala:536)
    at org.jetbrains.jps.incremental.scala.ScalaBuilder$$anonfun$5$$anonfun$apply$3.apply(ScalaBuilder.scala:100)
    at org.jetbrains.jps.incremental.scala.ScalaBuilder$$anonfun$5$$anonfun$apply$3.apply(ScalaBuilder.scala:99)
    at scala.util.Either$RightProjection.flatMap(Either.scala:523)
    at org.jetbrains.jps.incremental.scala.ScalaBuilder$$anonfun$5.apply(ScalaBuilder.scala:99)
    at org.jetbrains.jps.incremental.scala.ScalaBuilder$$anonfun$5.apply(ScalaBuilder.scala:98)
    at scala.util.Either$RightProjection.flatMap(Either.scala:523)
    at org.jetbrains.jps.incremental.scala.ScalaBuilder.doBuild(ScalaBuilder.scala:98)
    at org.jetbrains.jps.incremental.scala.ScalaBuilder.build(ScalaBuilder.scala:68)
    at org.jetbrains.jps.incremental.scala.ScalaBuilderService$ScalaBuilderDecorator.build(ScalaBuilderService.java:42)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:998)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:739)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:770)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:702)
    at org.jetbrains.jps.incremental.IncProjectBuilder.access$900(IncProjectBuilder.java:79)
    at org.jetbrains.jps.incremental.IncProjectBuilder$BuildParallelizer$2.run(IncProjectBuilder.java:671)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:35)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

2 comments

Looks like you missed scala-reflect.jar in your dependencies.

Best regards,
Aleksandr Podkhaliuzin.

0

I had the lib. This problem only occur when I try to add scala facet into existing java project. There is no issue when I create new scala project.
I did 2 things which seems worked:
1. I separate scala compiler lib from scala runtime lib and only include runtime lib in the dependency.
2. I put scala-compiler.java only in the compiler lib.
Thanks.

0

Please sign in to leave a comment.