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.
NullPointerException is thrown when a reference variable is accessed (or de-referenced) and is not pointing to any object. This error can be resolved by using a try-catch block or an if-else condition to check if a reference variable is null before dereferencing it.
If a caller passes null in some parameter for which null values are prohibited, convention dictates that NullPointerException be thrown rather than IllegalArgumentException .” So if you must allow NullPointerException in some places in your code then make sure you make them more informative than they usually are.
NullPointerException is thrown when an application attempts to use an object reference that has the null value. These include: Calling an instance method on the object referred by a null reference. Accessing or modifying an instance field of the object referred by a null reference.
Programmers typically catch NullPointerException under three circumstances: The program contains a null pointer dereference. Catching the resulting exception was easier than fixing the underlying problem. The program explicitly throws a NullPointerException to signal an error condition.
I had java version 10.x
and javac version 1.8x
. I downgraded java version
to 8, and the problem seems to have fixed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With