构建scala项目时Intellij 12和内部编译错误

时间:2012-12-24 19:08:22

标签: scala intellij-idea

我刚刚下载了Intellij 12.01(build#IC-123.94),一旦我尝试构建Scala项目,我得到以下stacktrace:

Internal error: (java.lang.ClassNotFoundException) org.jetbrains.jps.incremental.BinaryContent
java.lang.ClassNotFoundException: org.jetbrains.jps.incremental.BinaryContent
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at org.jetbrains.jps.incremental.scala.LazyCompiledClass.<init>(ScalaBuilder.scala:239)
    at org.jetbrains.jps.incremental.scala.IdeClient.generated(ScalaBuilder.scala:230)
    at org.jetbrains.jps.incremental.scala.remote.ClientEventProcessor.process(ClientEventProcessor.scala:17)
    at org.jetbrains.jps.incremental.scala.remote.RemoteServer$.liftedTree1$1(RemoteServer.scala:76)
    at org.jetbrains.jps.incremental.scala.remote.RemoteServer$.org$jetbrains$jps$incremental$scala$remote$RemoteServer$$handle(RemoteServer.scala:74)
    at org.jetbrains.jps.incremental.scala.remote.RemoteServer$$anonfun$send$1$$anonfun$apply$1$$anonfun$apply$3.apply(RemoteServer.scala:44)
    at org.jetbrains.jps.incremental.scala.remote.RemoteServer$$anonfun$send$1$$anonfun$apply$1$$anonfun$apply$3.apply(RemoteServer.scala:43)
    at org.jetbrains.jps.incremental.scala.package$.using(package.scala:15)
    at org.jetbrains.jps.incremental.scala.remote.RemoteServer$$anonfun$send$1$$anonfun$apply$1.apply(RemoteServer.scala:43)
    at org.jetbrains.jps.incremental.scala.remote.RemoteServer$$anonfun$send$1$$anonfun$apply$1.apply(RemoteServer.scala:40)
    at org.jetbrains.jps.incremental.scala.package$.using(package.scala:15)
    at org.jetbrains.jps.incremental.scala.remote.RemoteServer$$anonfun$send$1.apply(RemoteServer.scala:40)
    at org.jetbrains.jps.incremental.scala.remote.RemoteServer$$anonfun$send$1.apply(RemoteServer.scala:39)
    at org.jetbrains.jps.incremental.scala.package$.using(package.scala:15)
    at org.jetbrains.jps.incremental.scala.remote.RemoteServer.send(RemoteServer.scala:39)
    at org.jetbrains.jps.incremental.scala.remote.RemoteServer.compile(RemoteServer.scala:24)
    at org.jetbrains.jps.incremental.scala.ScalaBuilder$$anonfun$5$$anonfun$apply$3$$anonfun$apply$4.apply(ScalaBuilder.scala:110)
    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:67)
    at org.jetbrains.jps.incremental.scala.ScalaBuilderService$ScalaBuilderDecorator.build(ScalaBuilderService.java:42)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:963)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:710)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:740)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:673)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:494)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:274)
    at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:164)
    at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:114)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:205)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:102)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:107)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:26)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

显然,问题来自Intellij的lib文件夹中的openapi.jar,该文件夹应该包含这样的类。

任何指针?

问候。

2 个答案:

答案 0 :(得分:6)

与Idea 12有同样的问题,但在将Scala插件更新到0.7.62之后,问题已经解决了。

但是,您可以尝试遵循Idea的建议:

  

如果出现任何编译问题,您可以通过清除以下内容(内部)编译器来启用:            项目设置/编译器/使用外部版本

答案 1 :(得分:0)

对我来说同样的问题,通过更新到夜间版本(0.7.82)修复,此处提供的说明:http://confluence.jetbrains.net/display/SCA/Scala+Plugin+Nightly+Builds+for+Leda