在idea中执行scala程序是出现问题

Error:scalac: Error: Could not find an output directory for D:\work\ideawork\SDKBehaviorSpark\src\main\scala\com\bonree\sdk\behavior\executor\day\SingleDayActiveUserExecutor.scala in List((D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\resource_managed\test,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\test\resources,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\resource_managed\main,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\main\resources,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\src_managed\test,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\test\scala-2.10,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\test\scala,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\test\java,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\src_managed\main,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\main\scala-2.10,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\main\scala,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\main\java,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes))
scala.reflect.internal.FatalError: Could not find an output directory for D:\work\ideawork\SDKBehaviorSpark\src\main\scala\com\bonree\sdk\behavior\executor\day\SingleDayActiveUserExecutor.scala in List((D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\resource_managed\test,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\test\resources,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\resource_managed\main,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\main\resources,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\src_managed\test,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\test\scala-2.10,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\test\scala,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\test\java,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\src_managed\main,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\main\scala-2.10,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\main\scala,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes), (D:\work\ideawork\sdkbehaviorspark\src\main\java,D:\work\ideawork\sdkbehaviorspark\target\scala-2.10\classes))

	at scala.tools.nsc.settings.MutableSettings$OutputDirs.outputDirFor(MutableSettings.scala:303)

	at scala.tools.nsc.backend.jvm.BytecodeWriters$class.outputDirectory(BytecodeWriters.scala:26)

	at scala.tools.nsc.backend.jvm.BytecodeWriters$class.scala$tools$nsc$backend$jvm$BytecodeWriters$$getFile(BytecodeWriters.scala:37)

	at scala.tools.nsc.backend.jvm.BytecodeWriters$ClassBytecodeWriter$class.writeClass(BytecodeWriters.scala:89)

	at scala.tools.nsc.backend.jvm.GenASM$AsmPhase$$anon$4.writeClass(GenASM.scala:67)

	at scala.tools.nsc.backend.jvm.GenASM$JBuilder.writeIfNotTooBig(GenASM.scala:459)

	at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genClass(GenASM.scala:1413)

	at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.run(GenASM.scala:120)

	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1583)

	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1557)

	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1553)

	at scala.tools.nsc.Global$Run.compile(Global.scala:1662)

	at xsbt.CachedCompiler0.run(CompilerInterface.scala:115)

	at xsbt.CachedCompiler0.run(CompilerInterface.scala:94)

	at xsbt.CompilerInterface.run(CompilerInterface.scala:22)

	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:101)

	at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)

	at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)

	at org.jetbrains.jps.incremental.scala.local.IdeaIncrementalCompiler.compile(IdeaIncrementalCompiler.scala:29)

	at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:26)

	at org.jetbrains.jps.incremental.scala.remote.Main$.make(Main.scala:67)

	at org.jetbrains.jps.incremental.scala.remote.Main$.nailMain(Main.scala:24)

	at org.jetbrains.jps.incremental.scala.remote.Main.nailMain(Main.scala)

	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 com.martiansoftware.nailgun.NGSession.run(NGSession.java:319)

在执行scala程序是出现上面的问题,解决办法:

选择项目点击右键——>Mark Directory As ——>Test Sources Root


你可能感兴趣的:(scala)