title: maven ignores maven.compiler.source
body: <p>I have</p>
  
  <pre><code>&lt;properties&gt;
      &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <p>in my <code>pom.xml</code>.</p>
  
  <p>If I run <code>mvn clean install</code> then I can't run the compiled classes with Java 1.8 (I get crashes with errors like <code>java.lang.NoClassDefFoundError: Could not initialize class</code> when I try to).</p>
  
  <p>I am forced to run</p>
  
  <pre><code>JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home mvn clean install
  </code></pre>
  
  <p>if I want it to be able to run the built jar with java 8 without crashes.</p>
  
  <p>How can I make it actually use the correct JDK that I want?</p>
  
  <hr>
  
  <p>Here is how my machine seems to be set up by default</p>
  
  <pre><code>$ mvn -version
  Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T19:41:47+01:00)
  Maven home: /usr/local/Cellar/maven/3.6.0/libexec
  Java version: 11.0.1, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/openjdk-11.0.1.jdk/Contents/Home
  Default locale: en_GB, platform encoding: UTF-8
  OS name: "mac os x", version: "10.14.2", arch: "x86_64", family: "mac"
  $ java -version
  openjdk version "11.0.1" 2018-10-16
  OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
  OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
  $ echo $JAVA_HOME
  
  $
  </code></pre>