title: Maven Installation OSX Error Unsupported major.minor version 51.0
body: <p>I installed maven by following this steps:(a tutorial)</p>
  
  <pre><code>JAVA_HOME=/Library/Java/Home
  export M2_HOME=/Users/steven/zimmermann/maven
  export M2=$M2_HOME/bin
  export PATH=$M2:$PATH
  
  echo $JAVA_HOME
  echo $M2_HOME
  echo $M2
  echo $PATH
  
  nano .bash_profile
  </code></pre>
  
  <p>then I wrote the echo in the .bash_profile sth like this:</p>
  
  <pre><code>JAVA_HOME=/usr/libexec/java_home
  M2_HOME=/path/to/your/apache-maven-3.x.x
  M2=/path/to/your/apache-maven-3.x.x/bin
  PATH=/path/to/maven/bin:/$….bla-bla-bla…
  </code></pre>
  
  <p>and also I wrote this in the .bashrc</p>
  
  <pre><code>export M2_HOME=/Users/steven/zimmermann/maven
  export M2=$M2_HOME/bin
  export PATH=$M2:$PATH
  </code></pre>
  
  <p>now when I want to check the version (<code>mvn -v</code>) I get the following exception:
  I think there are some versions wrong, but I don't know. </p>
  
  <pre><code>Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401)
      at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:254)
      at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
      at org.codehaus.plexus.classworlds.launcher.Launcher.getMainClass(Launcher.java:144)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:266)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  </code></pre>
  
  <p>Additional information:</p>
  
  <pre><code>java -version
  </code></pre>
  
  <blockquote>
  <pre><code>java version "1.8.0_40"
  Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
  Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
  </code></pre>
  </blockquote>
  
  <pre><code>javac -version
  </code></pre>
  
  <blockquote>
  <pre><code>javac 1.8.0_40
  </code></pre>
  </blockquote>