Учебник по тестированию sbt приводит к отражающей ошибке доступа

Пытаюсь завершить учебник по тестированию sbt

Выполняю все шаги и запускаю sbt test. Однако я получаю исключение с нулевым указателем, которое я не знаю, как разрешить.

C:\Users\Sayth\OneDrive\Projects\scalatest\scalatesttutorial>sbt test
Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
[info] Loading project definition from C:\Users\Sayth\OneDrive\Projects\scalatest\scalatesttutorial\project
[info] Updating {file:/C:/Users/Sayth/OneDrive/Projects/scalatest/scalatesttutorial/project/}scalatesttutorial-build...
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by sbt.ivyint.ErrorMessageAuthenticator$ (file:/C:/Users/Sayth/.sbt/boot/scala-2.10.7/org.scala-sbt/sbt/0.13.17/ivy-0.13.17.jar) to field java.net.Authenticator.theAuthenticator
WARNING: Please consider reporting this to the maintainers of sbt.ivyint.ErrorMessageAuthenticator$
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
java.lang.NullPointerException
        at scala.reflect.io.JavaToolsPlatformArchive.iterator(ZipArchive.scala:242)
        at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
        at scala.reflect.io.AbstractFile.foreach(AbstractFile.scala:92)
        at scala.tools.nsc.util.DirectoryClassPath.traverse(ClassPath.scala:308)
        at scala.tools.nsc.util.DirectoryClassPath.x$16$lzycompute(ClassPath.scala:317)
        at scala.tools.nsc.util.DirectoryClassPath.x$16(ClassPath.scala:317)
        at scala.tools.nsc.util.DirectoryClassPath.packages$lzycompute(ClassPath.scala:317)
        at scala.tools.nsc.util.DirectoryClassPath.packages(ClassPath.scala:317)
        at scala.tools.nsc.util.DirectoryClassPath.packages(ClassPath.scala:297)
        at scala.tools.nsc.util.MergedClassPath$$anonfun$packages$1.apply(ClassPath.scala:375)
        at scala.tools.nsc.util.MergedClassPath$$anonfun$packages$1.apply(ClassPath.scala:375)
        at scala.collection.Iterator$class.foreach(Iterator.scala:727)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
        at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
        at scala.tools.nsc.util.MergedClassPath.packages$lzycompute(ClassPath.scala:375)
        at scala.tools.nsc.util.MergedClassPath.packages(ClassPath.scala:370)
        at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader.doComplete(SymbolLoaders.scala:243)
        at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:194)
        at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1231)
        at scala.reflect.internal.Mirrors$RootsBase.init(Mirrors.scala:240)
        at scala.tools.nsc.Global.rootMirror$lzycompute(Global.scala:59)
        at scala.tools.nsc.Global.rootMirror(Global.scala:57)
        at scala.tools.nsc.Global.rootMirror(Global.scala:37)
        at scala.reflect.internal.Definitions$DefinitionsClass.<init>(Definitions.scala:166)
        at scala.reflect.internal.Definitions$definitions$.<init>(Definitions.scala:20)
        at scala.reflect.internal.SymbolTable.definitions$lzycompute(SymbolTable.scala:13)
        at scala.reflect.internal.SymbolTable.definitions(SymbolTable.scala:13)
        at scala.tools.nsc.Global$Run.<init>(Global.scala:1290)
        at sbt.compiler.Eval$$anon$1.<init>(Eval.scala:141)
        at sbt.compiler.Eval.run$lzycompute$1(Eval.scala:141)
        at sbt.compiler.Eval.run$1(Eval.scala:141)
        at sbt.compiler.Eval.unlinkAll$1(Eval.scala:144)
        at sbt.compiler.Eval.evalCommon(Eval.scala:153)
        at sbt.compiler.Eval.evalDefinitions(Eval.scala:122)
        at sbt.EvaluateConfigurations$.evaluateDefinitions(EvaluateConfigurations.scala:271)
        at sbt.EvaluateConfigurations$.evaluateSbtFile(EvaluateConfigurations.scala:109)
        at sbt.Load$.sbt$Load$$loadSettingsFile$1(Load.scala:775)
        at sbt.Load$$anonfun$sbt$Load$$memoLoadSettingsFile$1$1.apply(Load.scala:781)
        at sbt.Load$$anonfun$sbt$Load$$memoLoadSettingsFile$1$1.apply(Load.scala:780)
        at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
        at scala.collection.AbstractMap.getOrElse(Map.scala:58)
        at sbt.Load$.sbt$Load$$memoLoadSettingsFile$1(Load.scala:780)
        at sbt.Load$$anonfun$loadFiles$1$2.apply(Load.scala:788)
        at sbt.Load$$anonfun$loadFiles$1$2.apply(Load.scala:788)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
        at scala.collection.AbstractTraversable.map(Traversable.scala:105)
        at sbt.Load$.loadFiles$1(Load.scala:788)
        at sbt.Load$.discoverProjects(Load.scala:799)
        at sbt.Load$.discover$1(Load.scala:585)
        at sbt.Load$.sbt$Load$$loadTransitive(Load.scala:633)
        at sbt.Load$$anonfun$loadUnit$1.sbt$Load$$anonfun$$loadProjects$1(Load.scala:482)
        at sbt.Load$$anonfun$loadUnit$1$$anonfun$40.apply(Load.scala:485)
        at sbt.Load$$anonfun$loadUnit$1$$anonfun$40.apply(Load.scala:485)
        at sbt.Load$.timed(Load.scala:1025)
        at sbt.Load$$anonfun$loadUnit$1.apply(Load.scala:485)
        at sbt.Load$$anonfun$loadUnit$1.apply(Load.scala:459)
        at sbt.Load$.timed(Load.scala:1025)
        at sbt.Load$.loadUnit(Load.scala:459)
        at sbt.Load$$anonfun$25$$anonfun$apply$14.apply(Load.scala:311)
        at sbt.Load$$anonfun$25$$anonfun$apply$14.apply(Load.scala:310)
        at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:91)
        at sbt.BuildLoader$$anonfun$componentLoader$1$$anonfun$apply$4$$anonfun$apply$5$$anonfun$apply$6.apply(BuildLoader.scala:90)
        at sbt.BuildLoader.apply(BuildLoader.scala:140)
        at sbt.Load$.loadAll(Load.scala:365)
        at sbt.Load$.loadURI(Load.scala:320)
        at sbt.Load$.load(Load.scala:316)
        at sbt.Load$.load(Load.scala:305)
        at sbt.Load$$anonfun$4.apply(Load.scala:146)
        at sbt.Load$$anonfun$4.apply(Load.scala:146)
        at sbt.Load$.timed(Load.scala:1025)
        at sbt.Load$.apply(Load.scala:146)
        at sbt.Load$.defaultLoad(Load.scala:39)
        at sbt.BuiltinCommands$.liftedTree1$1(Main.scala:503)
        at sbt.BuiltinCommands$.doLoadProject(Main.scala:503)
        at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:495)
        at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:495)
        at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
        at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:59)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
        at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:61)
        at sbt.Command$.process(Command.scala:93)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
        at sbt.MainLoop$$anonfun$1$$anonfun$apply$1.apply(MainLoop.scala:96)
        at sbt.State$$anon$1.runCmd$1(State.scala:183)
        at sbt.State$$anon$1.process(State.scala:187)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
        at sbt.MainLoop$$anonfun$1.apply(MainLoop.scala:96)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.MainLoop$.next(MainLoop.scala:96)
        at sbt.MainLoop$.run(MainLoop.scala:89)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:68)
        at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:63)
        at sbt.Using.apply(Using.scala:24)
        at sbt.MainLoop$.runWithNewLog(MainLoop.scala:63)
        at sbt.MainLoop$.runAndClearLast(MainLoop.scala:46)
        at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:30)
        at sbt.MainLoop$.runLogged(MainLoop.scala:22)
        at sbt.StandardMain$.runManaged(Main.scala:61)
        at sbt.xMain.run(Main.scala:35)
        at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
        at xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
        at xsbt.boot.Launch$.run(Launch.scala:109)
        at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
        at xsbt.boot.Launch$.launch(Launch.scala:117)
        at xsbt.boot.Launch$.apply(Launch.scala:18)
        at xsbt.boot.Boot$.runImpl(Boot.scala:56)
        at xsbt.boot.Boot$.main(Boot.scala:18)
        at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.NullPointerException
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?

какая версия java?

Milo Lu 10.09.2018 10:53

@MiloLu javac 10.0.2

sayth 10.09.2018 11:17
1
2
960
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

Есть некоторые проблемы совместимости между scala и последней версией java. Если вы удалите java 10, а затем установите вместо него java 8, эти ошибки исчезнут.

Это четко указано на том же сайте начало работы со Scala-и-sbt-в-командной-строке

Make sure you have the Java 8 JDK (also known as 1.8)

Другие вопросы по теме