(求解答)在Windows安装scala2.12.3 版本,在cmd中输入scala后,报以下错误:

Exception in thread "main" java.lang.NullPointerException
at java.util.Arrays.sort(Arrays.java:1438)
at scala.tools.nsc.classpath.JFileDirectoryLookup.listChildren(DirectoryClassPath.scala:113)
at scala.tools.nsc.classpath.JFileDirectoryLookup.listChildren$(DirectoryClassPath.scala:97)
at scala.tools.nsc.classpath.DirectoryClassPath.listChildren(DirectoryClassPath.scala:202)
at scala.tools.nsc.classpath.DirectoryClassPath.listChildren(DirectoryClassPath.scala:202)
at scala.tools.nsc.classpath.DirectoryLookup.list(DirectoryClassPath.scala:73)
at scala.tools.nsc.classpath.DirectoryLookup.list$(DirectoryClassPath.scala:69)
at scala.tools.nsc.classpath.DirectoryClassPath.list(DirectoryClassPath.scala:202)
at scala.tools.nsc.classpath.AggregateClassPath.$anonfun$list$1(AggregateClassPath.scala:76)
at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
at scala.collection.Iterator.foreach(Iterator.scala:929)
at scala.collection.Iterator.foreach$(Iterator.scala:929)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1417)
at scala.collection.IterableLike.foreach(IterableLike.scala:71)
at scala.collection.IterableLike.foreach$(IterableLike.scala:70)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.collection.TraversableLike.map(TraversableLike.scala:234)
at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
at scala.collection.AbstractTraversable.map(Traversable.scala:104)
at scala.tools.nsc.classpath.AggregateClassPath.list(AggregateClassPath.scala:74)
at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader.doComplete(SymbolLoaders.scala:269)
at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:218)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1531)
at scala.reflect.internal.Mirrors$RootsBase.init(Mirrors.scala:225)
at scala.tools.nsc.Global.rootMirror$lzycompute(Global.scala:65)
at scala.tools.nsc.Global.rootMirror(Global.scala:63)
at scala.tools.nsc.Global.rootMirror(Global.scala:36)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:267)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:267)
at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1448)
at scala.tools.nsc.Global$Run.(Global.scala:1154)
at scala.tools.nsc.interpreter.IMain._initialize(IMain.scala:125)
at scala.tools.nsc.interpreter.IMain.initializeSynchronous(IMain.scala:147)
at scala.tools.nsc.interpreter.ILoop.$anonfun$process$12(ILoop.scala:1050)
at scala.tools.nsc.interpreter.ILoop.startup$1(ILoop.scala:1017)
at scala.tools.nsc.interpreter.ILoop.$anonfun$process$1(ILoop.scala:1067)
at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:949)
at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:82)
at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:85)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:96)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:101)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

1个回答

空指针异常,应该是环境变量没配置吧,所有找不到

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问