title: Maven error with Java 8
body: <p>Getting an error with Maven and Java 8 (jdk1.8.0_45). This issue does not occur with Java 7.</p>
  
  <p><strong>MCVE</strong></p>
  
  <p>Create a sample maven project. For example:</p>
  
  <pre><code>mvn archetype:create -DgroupId=testinovke -DartifactId=testinvoke
  </code></pre>
  
  <p>Create the following content in the generated App.java file</p>
  
  <pre><code>package testinovke;
  
  import java.lang.invoke.MethodHandle;
  import java.lang.invoke.MethodHandles;
  import java.lang.invoke.MethodType;
  
  public class App {
  
      public static MethodHandles.Lookup lookup;
  
      public static class Check {
          public void primitive(final int i){
          }
          public void wrapper(final Integer i){
          }
      }
  
  
      public static void main(String[] args) throws Throwable {
          Check check = new Check();
  
          MethodType type = MethodType.methodType(void.class, int.class);
  
          MethodHandle mh = lookup.findVirtual(Check.class, "primitive", type);
          mh.invoke();
      }
  }
  </code></pre>
  
  <p>Compile the maven project:</p>
  
  <pre><code>mvn clean compile
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <p>Get the following error:</p>
  
  <pre><code>testinvoke/src/main/java/testinovke/App.java:[25,18] method invoked with incorrect number of arguments; expected 0, found 1
  </code></pre>
  
  <p>Tried it with both Maven 3.0.4 and 3.3.3.
  This issue does not exist if I directly compile against App.java using Javac command.</p>