我的设置:
Ubuntu 12.04
Java 1.6.0_45
日食 3.7.2
Scala IDE 2.0.0.v-2_08-201112200107-82421c5
情况:我尝试运行 Kafka 的源代码,它是用 Scala 编写的,并带有 java 文件。导入后(似乎没有错误),问题视图显示如下:
错误描述:SBT 构建器在编译您的项目时崩溃。这是 Scala 编译器或 SBT 中的错误。检查错误日志以了解详细信息。错误信息是:空
堆栈跟踪:
!ENTRY org.scala-ide.sdt.core 4 4 2013-06-18 10:03:48.583
!MESSAGE Error during askOption
!STACK 0
java.lang.NullPointerException
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$addDefaultGetters$2$$anonfun$apply$13.apply(Namers.scala:1043)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$addDefaultGetters$2$$anonfun$apply$13.apply(Namers.scala:968)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$addDefaultGetters$2.apply(Namers.scala:968)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$addDefaultGetters$2.apply(Namers.scala:965)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123)
at scala.collection.immutable.List.foldLeft(List.scala:45)
at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:139)
at scala.collection.immutable.List.$div$colon(List.scala:45)
at scala.tools.nsc.typechecker.Namers$Namer.addDefaultGetters(Namers.scala:965)
at scala.tools.nsc.typechecker.Namers$Namer.methodSig(Namers.scala:918)
at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1165)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$typeCompleter$1.apply(Namers.scala:545)
at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$typeCompleter$1.apply(Namers.scala:543)
at scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1345)
at scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1341)
at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:747)
at scala.tools.nsc.symtab.Symbols$Symbol.paramss(Symbols.scala:952)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$DefOwner$class.addDef(ScalaStructureBuilder.scala:645)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$Builder.addDef(ScalaStructureBuilder.scala:839)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$DefOwner$class.addDef(ScalaStructureBuilder.scala:635)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$Builder.addDef(ScalaStructureBuilder.scala:839)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser.traverse(ScalaStructureBuilder.scala:913)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:920)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:920)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser.traverse(ScalaStructureBuilder.scala:920)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:920)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:920)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser.traverse(ScalaStructureBuilder.scala:920)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:920)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser$$anonfun$traverse$1.apply(ScalaStructureBuilder.scala:920)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser$TreeTraverser.traverse(ScalaStructureBuilder.scala:920)
at scala.tools.eclipse.javaelements.ScalaStructureBuilder$StructureBuilderTraverser.traverse(ScalaStructureBuilder.scala:871)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$buildStructure$2$$anonfun$apply$4$$anonfun$apply$1.apply$mcV$sp(ScalaCompilationUnit.scala:77)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$buildStructure$2$$anonfun$apply$4$$anonfun$apply$1.apply(ScalaCompilationUnit.scala:76)
at scala.tools.eclipse.javaelements.ScalaCompilationUnit$$anonfun$buildStructure$2$$anonfun$apply$4$$anonfun$apply$1.apply(ScalaCompilationUnit.scala:76)
at scala.tools.nsc.util.InterruptReq.liftedTree1$1(InterruptReq.scala:20)
at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:19)
at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:330)
at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:22)
!ENTRY org.scala-ide.sdt.core 4 4 2013-06-18 10:04:27.824
!MESSAGE Crash in the build compiler.
!STACK 0
java.lang.NullPointerException
at scala.tools.nsc.settings.MutableSettings$OutputDirs$$anonfun$outputDirFor$1.apply(MutableSettings.scala:295)
at scala.tools.nsc.settings.MutableSettings$OutputDirs$$anonfun$outputDirFor$1.apply(MutableSettings.scala:295)
at scala.Function2$$anonfun$tupled$1.apply(Function2.scala:53)
at scala.Function2$$anonfun$tupled$1.apply(Function2.scala:52)
at scala.collection.LinearSeqOptimized$class.find(LinearSeqOptimized.scala:102)
at scala.collection.immutable.List.find(List.scala:45)
at scala.tools.nsc.settings.MutableSettings$OutputDirs.outputDirFor(MutableSettings.scala:295)
at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.getFile(GenJVM.scala:1706)
at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.emitClass(GenJVM.scala:146)
at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genClass(GenJVM.scala:269)
at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.apply(GenJVM.scala:56)
at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun$run$3.apply(GenJVM.scala:52)
at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun$run$3.apply(GenJVM.scala:52)
at scala.collection.mutable.HashMap$$anon$2$$anonfun$foreach$3.apply(HashMap.scala:89)
at scala.collection.mutable.HashMap$$anon$2$$anonfun$foreach$3.apply(HashMap.scala:89)
at scala.collection.Iterator$class.foreach(Iterator.scala:631)
at scala.collection.mutable.HashTable$$anon$1.foreach(HashTable.scala:161)
at scala.collection.mutable.HashTable$class.foreachEntry(HashTable.scala:194)
at scala.collection.mutable.HashMap.foreachEntry(HashMap.scala:39)
at scala.collection.mutable.HashMap$$anon$2.foreach(HashMap.scala:89)
at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run(GenJVM.scala:52)
at scala.tools.nsc.Global$Run.compileSources(Global.scala:761)
at scala.tools.nsc.Global$Run.compile(Global.scala:842)
at xsbt.CompilerInterface.run(CompilerInterface.scala:106)
at scala.tools.eclipse.buildmanager.sbtintegration.ScalaSbtCompiler.compile(ScalaSbtCompiler.scala:35)
at scala.tools.eclipse.buildmanager.sbtintegration.AnalysisCompile$$anonfun$8.compileScala$1(AnalysisCompile.scala:124)
at scala.tools.eclipse.buildmanager.sbtintegration.AnalysisCompile$$anonfun$8.apply(AnalysisCompile.scala:162)
at scala.tools.eclipse.buildmanager.sbtintegration.AnalysisCompile$$anonfun$8.apply(AnalysisCompile.scala:99)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:21)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:19)
at sbt.inc.Incremental$.cycle(Incremental.scala:33)
at sbt.inc.Incremental$.compile(Incremental.scala:20)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:17)
at scala.tools.eclipse.buildmanager.sbtintegration.AnalysisCompile.doCompile(AnalysisCompile.scala:180)
at scala.tools.eclipse.buildmanager.sbtintegration.EclipseSbtBuildManager.runCompiler(EclipseSbtBuildManager.scala:360)
at scala.tools.eclipse.buildmanager.sbtintegration.EclipseSbtBuildManager.update(EclipseSbtBuildManager.scala:327)
at scala.tools.eclipse.buildmanager.sbtintegration.EclipseSbtBuildManager.build(EclipseSbtBuildManager.scala:389)
at scala.tools.eclipse.ScalaProject.build(ScalaProject.scala:697)
at scala.tools.eclipse.ScalaBuilder.build(ScalaBuilder.scala:107)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
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:54)