ScalaIDE和隐藏的ClassNotFound错误

时间:2014-06-16 22:16:46

标签: scala scala-ide classnotfound

问题

使用Scala IDE,我得到了一个神秘的NullPointerException,其中找不到“src / test / scala”下面的类别...我的IDE详细信息是:

相关

相关问题(请参阅http://www.stackoverflow.com/questions/9686517/scala-eclipse-plugin-java-lang-classnotfoundexception)在一段时间(2年前)得到了回答,但似乎我在新的ScalaIDE中看到了相同的错误(仅在一周前下载了2.10)。

系统详细信息和堆栈跟踪

eclipse.buildId=3.0.3-20140327-1716-Typesafe
java.version=1.7.0_55
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -keyring /Users/bigpetstore/.eclipse_keyring -showlocation
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -keyring /Users/bigpetstore    /.eclipse_keyring -showlocation

例外情况如下

java.lang.NullPointerException
    at scala.collection.convert.Wrappers$JEnumerationWrapper.hasNext(Wrappers.scala:46)
    at scala.collection.Iterator$$anon$11.hasNext(Iterator.scala:327)
    at scala.collection.Iterator$class.toStream(Iterator.scala:1143)
    at scala.collection.AbstractIterator.toStream(Iterator.scala:1157)
    at scala.collection.TraversableOnce$class.toIterable(TraversableOnce.scala:259)
    at scala.collection.AbstractIterator.toIterable(Iterator.scala:1157)
    at scala.tools.eclipse.ScalaPlugin.sbtCompilerInterface$lzycompute(ScalaPlugin.scala:177)
    at scala.tools.eclipse.ScalaPlugin.sbtCompilerInterface(ScalaPlugin.scala:177)
    at scala.tools.eclipse.buildmanager.sbtintegration.SbtInputs$$anon$5.scalac(SbtInputs.scala:71)
    at scala.tools.eclipse.buildmanager.sbtintegration.SbtInputs$$anon$5.scalac(SbtInputs.scala:63)
    at sbt.compiler.IC$.compile(IncrementalCompiler.scala:21)
    at scala.tools.eclipse.buildmanager.sbtintegration.EclipseSbtBuildManager.runCompiler(EclipseSbtBuildManager.scala:133)
    at scala.tools.eclipse.buildmanager.sbtintegration.EclipseSbtBuildManager.update(EclipseSbtBuildManager.scala:124)
    at scala.tools.eclipse.buildmanager.sbtintegration.EclipseSbtBuildManager.build(EclipseSbtBuildManager.scala:178)
    at scala.tools.eclipse.ScalaProject.build(ScalaProject.scala:666)
    at scala.tools.eclipse.ScalaBuilder.build(ScalaBuilder.scala:119)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

1 个答案:

答案 0 :(得分:1)

奇怪的是,我实际上能够通过简单地从SBT切换到精炼的编译器来解决这个问题:enter image description here

关于为什么SBT编译器可以工作但是“精炼”的任何想法都会失败,我想听听。

有一些相关的线程,但没有明确的答案(我)可以看到为什么SBT在编译时会抛出NPE。可能只是一个偶然的错误或插件中的错误,我正在触发它。

https://groups.google.com/forum/#!msg/scala-ide-user/Tscp9sLixJI/a52OR068dYAJ https://groups.google.com/forum/#!msg/scala-ide-user/H3ov9hBt5aA/uctURBzV2JwJ