title: Using the latest version of Scala gives java.lang.ClassNotFoundException: scala.Function1$class
body: <p>So I want to use the <a href="https://github.com/philcali/cronish" rel="nofollow noreferrer">cronish</a> library in my SBT project. </p>
  
  <p>My build.sbt looks like following</p>
  
  <pre><code>name := "SampleName"
  version := "1.0"
  scalaVersion := "2.12.4"
  libraryDependencies += "com.github.philcali" % "cronish_2.11" % "0.1.3"
  </code></pre>
  
  <p>I have to mention <code>cronish_2.11</code> explicitly because <code>cronish_2.12</code> does not exist. I'm running the project in workers.scala located at <code>$ProjectRoot/src/main/scala</code></p>
  
  <pre><code>import cronish._
  import cronish.dsl._
  
  object workers {
    def main(args: Array[String]) : Unit = {
  
      val payroll: CronTask = task {
        println("You have just been paid... Finally!")
      }
  
      payroll executes "every 5 seconds"
    }
  }
  </code></pre>
  
  <p>When I run it using <code>sbt run</code> is get the following error:</p>
  
  <pre><code>[error] (run-main-0) java.lang.NoClassDefFoundError: scala/Function1$class
  java.lang.NoClassDefFoundError: scala/Function1$class
      at scala.util.parsing.combinator.Parsers$Parser.&lt;init&gt;(Parsers.scala:225)
      at scala.util.parsing.combinator.RegexParsers$$anon$1.&lt;init&gt;(RegexParsers.scala:84)
      at scala.util.parsing.combinator.RegexParsers$class.literal(RegexParsers.scala:84)
      at cronish.dsl.Cronish$.literal(dsl.scala:209)
      at cronish.dsl.CronParsers$class.$init$(dsl.scala:28)
      at cronish.dsl.Cronish$.&lt;init&gt;(dsl.scala:209)
      at cronish.dsl.Cronish$.&lt;clinit&gt;(dsl.scala)
      at cronish.dsl.package$.string2cron(package.scala:7)
      at cronish.dsl.package$.&lt;init&gt;(package.scala:18)
      at cronish.dsl.package$.&lt;clinit&gt;(package.scala)
      at workers$.main(workers.scala:8)
      at workers.main(workers.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
  Caused by: java.lang.ClassNotFoundException: scala.Function1$class
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at scala.util.parsing.combinator.Parsers$Parser.&lt;init&gt;(Parsers.scala:225)
      at scala.util.parsing.combinator.RegexParsers$$anon$1.&lt;init&gt;(RegexParsers.scala:84)
      at scala.util.parsing.combinator.RegexParsers$class.literal(RegexParsers.scala:84)
      at cronish.dsl.Cronish$.literal(dsl.scala:209)
      at cronish.dsl.CronParsers$class.$init$(dsl.scala:28)
      at cronish.dsl.Cronish$.&lt;init&gt;(dsl.scala:209)
      at cronish.dsl.Cronish$.&lt;clinit&gt;(dsl.scala)
      at cronish.dsl.package$.string2cron(package.scala:7)
      at cronish.dsl.package$.&lt;init&gt;(package.scala:18)
      at cronish.dsl.package$.&lt;clinit&gt;(package.scala)
      at workers$.main(workers.scala:8)
      at workers.main(workers.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
  </code></pre>
  
  <p>I can get it to work if I change the <code>scalaVersion</code> to <code>2.11.x</code>. But I was wonder what is causing the error? Whats the best way to make this work with my current Scala version?</p>