sbt在ubuntu上使用scala 2.11

时间:2015-10-24 16:18:48

标签: java scala ubuntu sbt

当我尝试将代码上传到EC2 ubuntu实例时,我遇到了问题。我检查了我的java版本,scala版本和sbt版本,以及所有SEEMS到位,但我收到的错误似乎是版本问题。

这是我的build.sbt

name := "SentenceParserTimingStudy"

version := "1.0"

scalaVersion := "2.11.7"

mainClass in (Compile, run) := Some("TimingTester")
unmanagedJars in Compile += file("lib/stanford-srparser-2014-10-23-models.jar")

libraryDependencies += "edu.stanford.nlp" % "stanford-parser" % "3.5.2"
libraryDependencies += "edu.stanford.nlp" % "stanford-corenlp" % "3.5.2"

libraryDependencies +=  "io.argonaut" %% "argonaut" % "6.1-M4" changing()

libraryDependencies += "edu.stanford.nlp" % "stanford-corenlp" % "3.5.2" artifacts (Artifact("stanford-corenlp", "models"), Artifact("stanford-corenlp"))

我检查了我的java和scala版本,它们似乎是正确的

java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)    
Scala code runner version 2.11.7 -- Copyright 2002-2013, LAMP/EPFL

然而,每当我运行我的代码时,我都会收到此错误

[error] error while loading <root>, Error accessing /home/ubuntu/.ivy2/cache/edu.stanford.nlp/stanford-corenlp/jars/stanford-corenlp-3.5.2-models.jar
    scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
    at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
        at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18)
        at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
        at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
        at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
        at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
        at scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:102)
        at scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:105)
        at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:257)
        at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:257)
        at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1394)
        at scala.tools.nsc.Global$Run.<init>(Global.scala:1215)
        at xsbt.CachedCompiler0$$anon$2.<init>(CompilerInterface.scala:106)
        at xsbt.CachedCompiler0.run(CompilerInterface.scala:106)
        at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
        at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
        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:497)
        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 sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:51)
        at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:51)
        at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:51)
        at sbt.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:75)
        at sbt.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:50)
        at sbt.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:65)
        at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
        at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
        at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
        at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
        at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:31)
        at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:62)
        at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:61)
        at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:89)
        at sbt.inc.Incremental$.compile(Incremental.scala:61)
        at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
        at sbt.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
        at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
        at sbt.Compiler$.compile(Compiler.scala:128)
        at sbt.Compiler$.compile(Compiler.scala:114)
        at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:829)
        at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:820)
        at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:818)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:235)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    [error] (compile:compileIncremental) scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.

非常感谢任何帮助!

0 个答案:

没有答案