使用sbt的Scala项目抛出NullPointerException

时间:2018-05-28 05:48:00

标签: scala sbt

我从here克隆了该项目,并尝试通过打开目录并使用命令sbt将其加载到终端中。但这显示如下错误:

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:1130)
    at java.base/java.util.regex.Pattern.split(Pattern.java:1249)
    at java.base/java.util.regex.Pattern.split(Pattern.java:1322)
    at sbt.IO$.pathSplit(IO.scala:797)
    at sbt.IO$.parseClasspath(IO.scala:912)
    at sbt.compiler.CompilerArguments.extClasspath(CompilerArguments.scala:66)
    ...
    ...

我尝试了另一个项目pdffigures2。它显示了类似的错误:

[info] Loading project definition from /path/to/project/pdffigures2/project
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:1130)
    at java.base/java.util.regex.Pattern.split(Pattern.java:1249)
    at java.base/java.util.regex.Pattern.split(Pattern.java:1322)
    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)
    ...
    ...

并提示我重试,退出,持续或忽略。我再次尝试,只是为了得到相同的结果。

如果有帮助,我使用 Ubuntu 18.04

1 个答案:

答案 0 :(得分:2)

我有java version 10.xjavac version 1.8x。我将java version降级为8,问题似乎已经解决了