Scala sbt 项目给出 NullPointerException? [英] Scala sbt project gives NullPointerException?

查看:44
本文介绍了Scala sbt 项目给出 NullPointerException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的 sbt 项目中运行命令 sbt clean compile run 时,它给出了 Nullpointer 异常.

When i run the command sbt clean compile run in my sbt project it gives Nullpointer Exception.

这是控制台输出:

[info] Loading project definition from /home/dnilesh/workspace/wipworkspace/gtawip/project
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by sbt.ivyint.ErrorMessageAuthenticator$ (file:/root/.sbt/boot/scala-2.10.4/org.scala-sbt/sbt/0.13.8/ivy-0.13.8.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
java.lang.NullPointerException
    at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1769)
    at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
    at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
    at java.base/java.util.regex.Pattern.matcher(Pattern.java:1147)
    at java.base/java.util.regex.Pattern.split(Pattern.java:1264)
    at java.base/java.util.regex.Pattern.split(Pattern.java:1335)
    at sbt.IO$.pathSplit(IO.scala:744)
    at sbt.IO$.parseClasspath(IO.scala:859)
    at sbt.compiler.CompilerArguments.extClasspath(CompilerArguments.scala:62)
    at sbt.compiler.MixedAnalyzingCompiler$.withBootclasspath(MixedAnalyzingCompiler.scala:189)
    at sbt.compiler.MixedAnalyzingCompiler$.searchClasspathAndLookup(MixedAnalyzingCompiler.scala:167)
    at sbt.compiler.MixedAnalyzingCompiler$.apply(MixedAnalyzingCompiler.scala:177)
    at 

推荐答案

您是否有可能运行 Java 9+ 和旧版本的 sbt?

Is it possible that you have Java 9+ and an old version of sbt running?

请确保您至少运行 sbt 0.13.17 以兼容 JDK 9.

Please make sure that you are at least running sbt 0.13.17 for for JDK 9 compatibility.

这篇关于Scala sbt 项目给出 NullPointerException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆