Runtime NoClassDefFoundError: org/apache/spark/SparkConf despite compiling fine
<p>I've got the following simple code that I'm trying to run: </p>

<pre><code>import org.apache.spark.SparkConf

object WordCounter {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setAppName("Word Counter").setMaster("local")
  }
}
</code></pre>

<p>It is able to compile fine, but when i run it I get:</p>

<pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/spark/SparkConf
</code></pre>

<p>Which is pretty surprising since (1) I've got the <code>import</code> statement right there and (2) this was previously working.</p>

<p>I'm pretty sure this is because I recently changed my <code>sbt</code> files in the following way:</p>

<h1>build.sbt</h1>

<pre><code>name := "SparkPlayground"

version := "1.0"

scalaVersion := "2.11.8"

libraryDependencies += "org.apache.spark" %% "spark-core" % "2.0.0" % "provided"
libraryDependencies += "com.github.scala-incubator.io" %% "scala-io-core" % "0.4.3"
libraryDependencies += "com.github.scala-incubator.io" %% "scala-io-file" % "0.4.3"
libraryDependencies += "org.apache.hadoop" % "hadoop-streaming" % "2.7.0"

//added below 2 lines:
assemblyJarName in assembly := s"${name.value.replace(' ','-')}-${version.value}.jar"
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false)
</code></pre>

<h1>project/assembly.sbt</h1>

<pre><code>addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
</code></pre>

<p>Im rather new to sbt, but I think whats going on is that I need to create an uber jar of some sort and run everything from that context. Instead I'm directly calling the generated class. However, I don't see any uber jar created in my Intellij project.</p>

<p>How do I properly build and run this project, preferably via Intellij options and not manual SBT console commands?</p>