title: Even after SBT Assembly plugin, I get main" java.lang.NoClassDefFoundError: scala/Function0
body: <p>I added a file called plugins.sbt to my /project folder. I added the following line to this file</p>
  
  <pre><code>addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
  </code></pre>
  
  <p>In my build.scala I added the following line</p>
  
  <pre><code>object CoreBuild extends Build {
     import sbtassembly.AssemblyKeys._
  </code></pre>
  
  <p>I did a <code>sbt assembly</code> I got a large jar file which I scp'ed to my target server.</p>
  
  <p>Target server has</p>
  
  <pre><code>java version "1.8.0_91"
  Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
  Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
  </code></pre>
  
  <p>when I say <code>java -jar ./foo.jar com.abhi.Foo 10</code></p>
  
  <p>I get an error</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: scala/Function0
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
      at java.lang.Class.getMethod0(Class.java:3018)
      at java.lang.Class.getMethod(Class.java:1784)
      at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
      at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
  Caused by: java.lang.ClassNotFoundException: scala.Function0
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  </code></pre>
  
  <p>But I added the assembly plugin.... </p>