在intelliJ

时间:2016-11-11 12:34:13

标签: scala intellij-idea

我正在尝试使用intelliJ中的这些来源构建Scala中编写的一些示例项目。 https://github.com/hdinsight/spark-streaming-data-persistence-examples https://github.com/hdinsight/eventhubs-sample-event-producer

在克隆存储库之后,在Project Structure中,我将scala SDK添加到了库中,并将scala SDK,sbt-launch.jar添加到了模块中。我也创造了神器。我是Scala的新手,不确定我是否正确设置sdk(或其他依赖项)来构建intelliJ中的项目。 当我尝试构建时,第一个项目构建得很好,但第二个项目给了我这个错误消息。当

您是否知道问题可能是什么? (我可以在命令提示符下使用scalac)

Error:scalac: 
     while compiling: C:\Dev\Spark\EventHubIntegration\eventhubs-sample-event-producer\src\test\scala\samples\junit.scala
        during phase: typer
     library version: version 2.10.5
    compiler version: version 2.10.5
  reconstructed args: -nobootcp -javabootclasspath ; -classpath C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\deploy.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\access-bridge-32.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\cldrdata.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\dnsns.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\jaccess.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\jfxrt.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\localedata.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\nashorn.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\sunec.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\sunjce_provider.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\sunmscapi.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\sunpkcs11.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\ext\zipfs.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\javaws.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\jfr.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\jfxswt.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\management-agent.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\plugin.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.8.0_111\jre\lib\rt.jar;C:\Program Files (x86)\sbt\bin\sbt-launch.jar;C:\Program Files (x86)\scala\api\jars\jline-2.14.1-javadoc.jar;C:\Program Files (x86)\scala\api\jars\scala-compiler-2.12.0-javadoc.jar;C:\Program Files (x86)\scala\api\jars\scala-library-2.12.0-javadoc.jar;C:\Program Files (x86)\scala\api\jars\scala-parser-combinators_2.12-1.0.4-javadoc.jar;C:\Program Files (x86)\scala\api\jars\scala-reflect-2.12.0-javadoc.jar;C:\Program Files (x86)\scala\api\jars\scala-swing_2.12-2.0.0-M2-javadoc.jar;C:\Program Files (x86)\scala\api\jars\scala-xml_2.12-1.0.5-javadoc.jar;C:\Program Files (x86)\scala\api\jars\scalap-2.12.0-javadoc.jar;C:\Dev\Spark\EventHubIntegration\eventhubs-sample-event-producer\out\test\test;C:\Dev\Spark\EventHubIntegration\eventhubs-sample-event-producer\out\production\test;C:\Users\jinnapat.indrapiromk\.ivy2\cache\org.scala-lang\scala-library\jars\scala-library-2.10.5.jar;C:\Users\jinnapat.indrapiromk\.ivy2\cache\org.scala-lang\scala-reflect\jars\scala-reflect-2.10.5.jar
  last tree to typer: TypeTree(class AppTest)
              symbol: class AppTest in package samples (flags: )
   symbol definition: class AppTest extends AnyRef
                 tpe: samples.AppTest
       symbol owners: class AppTest -> package samples
      context owners: constructor AppTest -> class AppTest -> package samples
== Enclosing template or block ==
DefDef( // def <init>: <?> in class AppTest
  <method>
  "<init>"
  []
  List(Nil)
  <tpt> // tree.tpe=samples.AppTest
  Block(
    Apply(
      super."<init>"
      Nil
    )
    ()
  )
)
== Expanded type of tree ==
TypeRef(TypeSymbol(class AppTest extends AnyRef))
uncaught exception during compilation: scala.reflect.internal.FatalError

,然后是,

Error:scalac: Error: class StringContext does not have a member f
scala.reflect.internal.FatalError: class StringContext does not have a member f

    at scala.reflect.internal.Definitions$DefinitionsClass.scala$reflect$internal$Definitions$DefinitionsClass$$fatalMissingSymbol(Definitions.scala:1037)

    at scala.reflect.internal.Definitions$DefinitionsClass.getMember(Definitions.scala:1055)

    at scala.reflect.internal.Definitions$DefinitionsClass.getMemberMethod(Definitions.scala:1090)

    at scala.reflect.internal.Definitions$DefinitionsClass.StringContext_f(Definitions.scala:538)

    at scala.tools.reflect.FastTrack$class.fastTrack(FastTrack.scala:38)

    at scala.tools.nsc.Global$$anon$1.fastTrack$lzycompute(Global.scala:493)

    at scala.tools.nsc.Global$$anon$1.fastTrack(Global.scala:493)

    at scala.tools.nsc.typechecker.Namers$Namer.methodSig(Namers.scala:1141)

    at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1451)

    at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1463)

    at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:728)

    at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:727)

    at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:727)

    at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$logAndValidate(Namers.scala:1496)

    at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:727)

    at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:726)

    at scala.tools.nsc.typechecker.Namers$$anon$1.completeImpl(Namers.scala:1611)

    at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1619)

    at scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1609)

    at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1231)

    at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1374)

    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5295)

    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)

    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2928)

    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)

    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)

    at scala.collection.immutable.List.loop$1(List.scala:170)

    at scala.collection.immutable.List.mapConserve(List.scala:186)

    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3032)

    at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1919)

    at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1759)

    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5583)

    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)

    at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2928)

    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)

    at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$61.apply(Typers.scala:3032)

    at scala.collection.immutable.List.loop$1(List.scala:170)

    at scala.collection.immutable.List.mapConserve(List.scala:186)

    at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3032)

    at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5301)

    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5587)

    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5642)

    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5704)

    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:99)

    at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:464)

    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:91)

    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:91)

    at scala.collection.Iterator$class.foreach(Iterator.scala:727)

    at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)

    at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:91)

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

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:498)

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

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:498)

    at com.martiansoftware.nailgun.NGSession.run(NGSession.java:319)

0 个答案:

没有答案