title: Spring-Boot on mac with Java 8, Unsupported major.minor version 51.0
body: <p>I created a sample spring-boot project on my mac.  But when I try to run maven commands on it (such as <code>mvn spring-boot:run</code>), I get the following error:</p>
  
  <pre class="lang-none prettyprint-override"><code>Exception in thread "main" java.lang.UnsupportedClassVersionError:
  org/apache/maven/cli/MavenCli : unsupported major.minor version 51.0
  </code></pre>
  
  <p>followed of course by the obligatory stack trace.  I know from reading answers on many other similar (but not identical) questions, that this has something to do with compiling with a more recent version of Java, and then running with an earlier version of Java.  According to this chart:</p>
  
  <pre><code>J2SE 8 = 52
  J2SE 7 = 51
  J2SE 6.0 = 50
  J2SE 5.0 = 49
  JDK 1.4 = 48
  JDK 1.3 = 47
  JDK 1.2 = 46
  JDK 1.1 = 45
  </code></pre>
  
  <p>I must have somehow compiled with Java 7, and then somehow run with Java 6.  But I don't understand how this can be so.  I'm pretty sure I'm using Java 8.  For one thing, when I enter <code>java -version</code> in the terminal, I get:
  </p>
  
  <pre><code>java version "1.8.0_25"
  Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
  Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
  </code></pre>
  
  <p>Also, my pom clearly specifies to use Java 8:
  </p>
  
  <pre><code>  &lt;project&gt;
  
      &lt;!-- project info --&gt;
  
      &lt;name&gt;springboot-demo&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  
      &lt;parent&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
        &lt;version&gt;1.5.3.RELEASE&lt;/version&gt;
        &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
        &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
        &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
        &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
  
      &lt;!-- dependencies --&gt;
  
    &lt;/project&gt;
  </code></pre>
  
  <p>All the answers I've read so far say to compile with Java 6, or to just use Java 8... but I am using Java 8!  Also, since the error I'm getting says "51.0" instead of "52.0", doesn't that mean I'm compiling with Java 7?  As far as I know, I am only using Java 8!</p>
  
  <p>Most importantly, how do I fix this?</p>