title: Incompatible types: bad return type in lambda expression?
body: <p>Given the following code:</p>
  
  <pre><code>/**
   * Prints the grid with hint numbers.
   */
  private void printGridHints() {
    minesweeperGrid.forEach((k, v) -&gt; {
      v.stream().forEach(
          square -&gt; square.isMineLocatedHere() ? System.out.print("*") : System.out.print(square
              .getNumSurroundingMines()));
      System.out.println();
    });
  }
  </code></pre>
  
  <p>My compiler is giving me the following error:</p>
  
  <pre><code>error: incompatible types: bad return type in lambda expression
  
  square -&gt; square.isMineLocatedHere() ? System.out.print("*") : System.out.print(square
                                                                                  ^
  
  missing return value
  </code></pre>
  
  <p>I am running Gradle version 2.2, and I have JDK 8u31 installed. What's interesting that Eclipse does not show any compiler errors, even after I clean and rebuild my project, but when I run <code>gradle build</code> on the command line, I get this compiler error.</p>
  
  <p>Why am I getting this error, and how do I fix it?</p>