title: Lagom with Gradle - java.lang.NoClassDefFoundError: scala/Function1$class
body: <p>I am trying to run a Lagom service using Gradle - this might not seem to be a good idea, but I decided to give it a try for learning purposes.</p>
  
  <p>You can browse the repository here:
  <a href="https://github.com/ashofthephoenix/lagom-gradle-helloworld" rel="nofollow noreferrer">https://github.com/ashofthephoenix/lagom-gradle-helloworld</a></p>
  
  <p>When I <code>cd</code> into hello-impl and execute <code>gradle -t runPlayBinary</code> in the console - the service works.</p>
  
  <p>When I run the same command from the project level directory, it gives me this stack trace:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: scala/Function1$class
      at play.docs.Memoise.&lt;init&gt;(DocumentationHandler.scala:118)
      at play.docs.DocumentationHandler.&lt;init&gt;(DocumentationHandler.scala:26)
      at play.docs.DocumentationHandler.&lt;init&gt;(DocumentationHandler.scala:22)
      at play.docs.BuildDocHandlerFactory.fromJar(BuildDocHandlerFactory.java:88)
      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:498)
      at org.gradle.play.internal.run.DefaultVersionedPlayRunAdapter.getBuildDocHandler(DefaultVersionedPlayRunAdapter.java:140)
      at org.gradle.play.internal.run.PlayWorkerServer.startServer(PlayWorkerServer.java:91)
      at org.gradle.play.internal.run.PlayWorkerServer.start(PlayWorkerServer.java:76)
      at org.gradle.play.internal.run.PlayWorkerServer.execute(PlayWorkerServer.java:60)
      at org.gradle.play.internal.run.PlayWorkerServer.execute(PlayWorkerServer.java:36)
      at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:83)
      at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:35)
      at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:119)
      at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:64)
      at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:62)
      at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:67)
  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)
      ... 19 more
  </code></pre>
  
  <p>Could somebody tell me what is the problem here?</p>
  
  <p>Thank you.</p>