title: Why can't I use lambdas with Spark web framework in IntelliJ IDEA?
body: <p>I got a maven project with this dependency:</p>
  <pre><code>&lt;dependency&gt;
        &lt;groupId&gt;com.sparkjava&lt;/groupId&gt;
        &lt;artifactId&gt;spark-core&lt;/artifactId&gt;
        &lt;version&gt;2.0.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>And so this class:</p>
  <pre><code>package com.tengen;
  
  import static spark.Spark.*;
  import spark.*;
  
  /**
   * Created by diegoaguilar on 6/7/14.
   */
  public class WebServer {
  
      public static void main(String[] args) {
  
          get(&quot;/hello&quot;, (request, response) -&gt; {
              return &quot;Hello World!&quot;;
          });
  
      }
  }
  </code></pre>
  <p>I use lambdas as docs tell I can, actually that's an example from <a href="https://github.com/perwendel/spark" rel="nofollow noreferrer">official docs</a>. But IDE complains for:</p>
  <blockquote>
  <pre><code>Error:(13, 43) java: lambda expressions are not supported in -source 1.6
    (use -source 8 or higher to enable lambda expressions)
  </code></pre>
  </blockquote>
  <p>How can I get it to work?</p>
  <h3>EDIT. I did set Java 8 as SDK at project creation.</h3>