Scala - Trouble Shooting

Updated: 2018-12-08

Wrong Length After String Split

.split(delimiter, -1) to preserve all fields

Missing: PackratParsers

Error:

A needed class was not found. This could be due to an error in your runpath. Missing class: scala/util/parsing/combinator/PackratParsers
java.lang.NoClassDefFoundError: scala/util/parsing/combinator/PackratParsers
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:367)

Solution:

Add this to sbt:

libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.2"

or this to pom:

<dependency>
  <groupId>org.scala-lang.modules</groupId>
  <artifactId>scala-parser-combinators_2.11</artifactId>
  <version>1.0.2</version>
</dependency>