我已将scala和sbt版本分别更新为2.12.0和0.13.8。现在每个构建都会失败并出现错误:
java.lang.VerifyError: Uninitialized object exists on backward branch 209
Exception Details:
Location:
scala/collection/immutable/HashMap$HashTrieMap.split()Lscala/collection/immutable/Seq; @249: goto
Reason:
Error exists in the bytecode
Bytecode:
0000000: 2ab6 0057 04a0 001e b200 afb2 00b4 04bd
0000010: 0002 5903 2a53 c000 b6b6 00ba b600 bec0
0000020: 00c0 b02a b600 31b8 003b 3c1b 04a4 015e
0000030: 1b05 6c3d 2a1b 056c 2ab6 0031 b700 c23e
0000040: 2ab6 0031 021d 787e 3604 2ab6 0031 0210
0000050: 201d 647c 7e36 05bb 0014 59b2 00b4 2ab6
0000060: 0033 c000 b6b6 00c6 b700 c91c b600 cd3a
0000070: 0619 06c6 001a 1906 b600 d1c0 007d 3a07
0000080: 1906 b600 d4c0 007d 3a08 a700 0dbb 00d6
0000090: 5919 06b7 00d9 bf19 073a 0919 083a 0abb
00000a0: 0002 5915 0419 09bb 0014 59b2 00b4 1909
00000b0: c000 b6b6 00c6 b700 c903 b800 df3a 0e3a
00000c0: 0d03 190d b900 e301 0019 0e3a 1136 1036
00000d0: 0f15 0f15 109f 0027 150f 0460 1510 190d
00000e0: 150f b900 e602 00c0 0005 3a17 1911 1917
00000f0: b800 ea3a 1136 1036 0fa7 ffd8 1911 b800
0000100: eeb7 005c 3a0b bb00 0259 1505 190a bb00
0000110: 1459 b200 b419 0ac0 00b6 b600 c6b7 00c9
0000120: 03b8 00df 3a13 3a12 0319 12b9 00e3 0100
0000130: 1913 3a16 3615 3614 1514 1515 9f00 2715
0000140: 1404 6015 1519 1215 14b9 00e6 0200 c000
0000150: 053a 1819 1619 18b8 00f1 3a16 3615 3614
0000160: a7ff d819 16b8 00ee b700 5c3a 0cb2 00f6
0000170: b200 b405 bd00 0259 0319 0b53 5904 190c
0000180: 53c0 00b6 b600 bab6 00f9 b02a b600 3303
0000190: 32b6 00fb b0
Stackmap Table:
same_frame(@35)
full_frame(@141,{Object[#2],Integer,Integer,Integer,Integer,Integer,Object[#105]},{})
append_frame(@151,Object[#125],Object[#125])
full_frame(@209,{Object[#2],Integer,Integer,Integer,Integer,Integer,Object[#105],Object[#125],Object[#125],Object[#125],Object[#125],Top,Top,Object[#20],Object[#55],Integer,Integer,Object[#103]},{Uninitialized[#159],Uninitialized[#159],Integer,Object[#125]})
full_frame(@252,{Object[#2],Integer,Integer,Integer,Integer,Integer,Object[#105],Object[#125],Object[#125],Object[#125],Object[#125],Top,Top,Object[#20],Object[#55],Integer,Integer,Object[#103]},{Uninitialized[#159],Uninitialized[#159],Integer,Object[#125]})
full_frame(@312,{Object[#2],Integer,Integer,Integer,Integer,Integer,Object[#105],Object[#125],Object[#125],Object[#125],Object[#125],Object[#2],Top,Object[#20],Object[#55],Integer,Integer,Object[#103],Object[#20],Object[#55],Integer,Integer,Object[#103]},{Uninitialized[#262],Uninitialized[#262],Integer,Object[#125]})
full_frame(@355,{Object[#2],Integer,Integer,Integer,Integer,Integer,Object[#105],Object[#125],Object[#125],Object[#125],Object[#125],Object[#2],Top,Object[#20],Object[#55],Integer,Integer,Object[#103],Object[#20],Object[#55],Integer,Integer,Object[#103]},{Uninitialized[#262],Uninitialized[#262],Integer,Object[#125]})
full_frame(@395,{Object[#2],Integer},{})
at scala.collection.immutable.HashMap$.scala$collection$immutable$HashMap$$makeHashTrieMap(HashMap.scala:179)
at scala.collection.immutable.HashMap$HashMap1.updated0(HashMap.scala:211)
at scala.collection.immutable.HashMap.$plus(HashMap.scala:59)
at scala.collection.immutable.HashMap.$plus(HashMap.scala:62)
at scala.collection.immutable.Map$Map4.updated(Map.scala:201)
at scala.collection.immutable.Map$Map4.$plus(Map.scala:202)
at scala.collection.immutable.Map$Map4.$plus(Map.scala:180)
at scala.collection.mutable.MapBuilder.$plus$eq(MapBuilder.scala:29)
at scala.collection.mutable.MapBuilder.$plus$eq(MapBuilder.scala:25)
at scala.collection.generic.Growable.$anonfun$$plus$plus$eq$1(Growable.scala:59)
at scala.collection.generic.Growable$$Lambda$19/924699145.apply(Unknown Source)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
at scala.collection.generic.Growable.$plus$plus$eq(Growable.scala:59)
at scala.collection.generic.Growable.$plus$plus$eq$(Growable.scala:50)
at scala.collection.mutable.MapBuilder.$plus$plus$eq(MapBuilder.scala:25)
at scala.collection.generic.GenMapFactory.apply(GenMapFactory.scala:48)
at scala.sys.package$.env(package.scala:61)
at scala.tools.nsc.settings.ScalaSettings.defaultClasspath(ScalaSettings.scala:30)
at scala.tools.nsc.settings.ScalaSettings.defaultClasspath$(ScalaSettings.scala:30)
at scala.tools.nsc.settings.MutableSettings.defaultClasspath(MutableSettings.scala:19)
at scala.tools.nsc.settings.ScalaSettings.$init$(ScalaSettings.scala:60)
at scala.tools.nsc.settings.MutableSettings.<init>(MutableSettings.scala:20)
at scala.tools.nsc.Settings.<init>(Settings.scala:12)
at scala.tools.nsc.Driver.process(Driver.scala:41)
at scala.tools.nsc.Main.process(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:483)
at sbt.compiler.RawCompiler.apply(RawCompiler.scala:26)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:146)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:142)
at sbt.IO$.withTemporaryDirectory(IO.scala:291)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:142)
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:139)
at sbt.IO$.withTemporaryDirectory(IO.scala:291)
at sbt.compiler.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:139)
at sbt.compiler.ComponentCompiler$$anonfun$compileAndInstall$1.apply(ComponentCompiler.scala:63)
at sbt.compiler.ComponentCompiler$$anonfun$compileAndInstall$1.apply(ComponentCompiler.scala:60)
at sbt.IO$.withTemporaryDirectory(IO.scala:291)
at sbt.compiler.ComponentCompiler.compileAndInstall(ComponentCompiler.scala:60)
at sbt.compiler.ComponentCompiler$$anonfun$getLocallyCompiled$1.apply$mcV$sp(ComponentCompiler.scala:50)
at sbt.IfMissing$Define.apply(ComponentManager.scala:75)
at sbt.ComponentManager.sbt$ComponentManager$$createAndCache$1(ComponentManager.scala:39)
at sbt.ComponentManager$$anonfun$sbt$ComponentManager$$fromGlobal$1$1.apply(ComponentManager.scala:27)
at sbt.ComponentManager$$anonfun$sbt$ComponentManager$$fromGlobal$1$1.apply(ComponentManager.scala:26)
at sbt.ComponentManager$$anon$1.call(ComponentManager.scala:50)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at sbt.ComponentManager.lock(ComponentManager.scala:50)
at sbt.ComponentManager.lockGlobalCache(ComponentManager.scala:49)
at sbt.ComponentManager.sbt$ComponentManager$$fromGlobal$1(ComponentManager.scala:25)
at sbt.ComponentManager$$anonfun$files$1$$anonfun$apply$2.apply(ComponentManager.scala:44)
at sbt.ComponentManager$$anonfun$files$1$$anonfun$apply$2.apply(ComponentManager.scala:44)
at sbt.ComponentManager.sbt$ComponentManager$$getOrElse$1(ComponentManager.scala:32)
at sbt.ComponentManager$$anonfun$files$1.apply(ComponentManager.scala:44)
at sbt.ComponentManager$$anonfun$files$1.apply(ComponentManager.scala:44)
at sbt.ComponentManager$$anon$1.call(ComponentManager.scala:50)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
at xsbt.boot.Using$.withResource(Using.scala:10)
at xsbt.boot.Using$.apply(Using.scala:9)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at sbt.ComponentManager.lock(ComponentManager.scala:50)
at sbt.ComponentManager.lockLocalCache(ComponentManager.scala:47)
at sbt.ComponentManager.files(ComponentManager.scala:44)
at sbt.ComponentManager.file(ComponentManager.scala:53)
at sbt.compiler.ComponentCompiler.getLocallyCompiled(ComponentCompiler.scala:50)
at sbt.compiler.ComponentCompiler.apply(ComponentCompiler.scala:36)
at sbt.compiler.ComponentCompiler$$anon$1.apply(ComponentCompiler.scala:23)
at sbt.compiler.AnalyzingCompiler.loader(AnalyzingCompiler.scala:112)
at sbt.compiler.AnalyzingCompiler.getInterfaceClass(AnalyzingCompiler.scala:117)
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:98)
at sbt.compiler.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:56)
at sbt.compiler.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:51)
at sbt.compiler.CompilerCache$$anon$2.apply(CompilerCache.scala:47)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:39)
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:814)
at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:805)
at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:803)
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)
我使用的是jdk 1.8.0,OS X 10.11.6。这里是代码示例:
object Main {
def main(args: Array[String]) {
println("test")
}
}
使用scala 2.10
构建相同的代码UPD:build.sbt for 2.12 version
name := "hello_world_3"
version := "1.0"
scalaVersion := "2.12.0"
答案 0 :(得分:15)
问题出在轻微的JDK版本中。 Scala 2.12需要更新版本的JDK,然后是1.8.0_111。所以在JDK升级之后一切正常。感谢@rumoku