npk
npk

Reputation: 1800

Scala project using sbt throws NullPointerException

I cloned the project from here, and tried to load it in Terminal by opening the directory and using the command sbt. But this shows error like this:

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)
    ...
    ...

I tried another project, pdffigures2. It shows similar error:

[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)
    ...
    ...

and prompts me to retry, quit, last or ignore. I tried again, only to get the same result.

If it may help, I'm using Ubuntu 18.04.

Upvotes: 6

Views: 1852

Answers (1)

npk
npk

Reputation: 1800

I had java version 10.x and javac version 1.8x. I downgraded java version to 8, and the problem seems to have fixed

Upvotes: 5

Related Questions