title: Error when executing tests in java maven jacoco: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
body: <p>Error when executing tests in java maven jacoco: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test</p>
  
  <p>Good Morning. I am carrying out a Maven project and I use NetBeans to write Java code. When I try to run a test file, I get this error:</p>
  
  <pre><code>cd C:\Users\ruimi\Documents\NetBeansProjects\erro_testes_unitarios; "JAVA_HOME=C:\\Program Files\\Java\\jdk-14" cmd /c "\"C:\\Program Files\\netbeans 11.3 tenativa 1000\\NetBeans-11.3\\netbeans\\java\\maven\\bin\\mvn.cmd\" -Dtest=com.mycompany.erro_testes_unitarios.NewMainTest -Dmaven.ext.class.path=\"C:\\Program Files\\netbeans 11.3 tenativa 1000\\NetBeans-11.3\\netbeans\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 test-compile surefire:test"
  Scanning for projects...
  
  ------------------------------------------------------------------------
  Building erro_testes_unitarios 1.0-SNAPSHOT
  ------------------------------------------------------------------------
  
  --- jacoco-maven-plugin:0.7.7.201606060606:prepare-agent (default) @ erro_testes_unitarios ---
  argLine set to -javaagent:C:\\Users\\ruimi\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.7.7.201606060606\\org.jacoco.agent-0.7.7.201606060606-runtime.jar=destfile=C:\\Users\\ruimi\\Documents\\NetBeansProjects\\erro_testes_unitarios\\target\\jacoco.exec
  
  --- maven-resources-plugin:2.6:resources (default-resources) @ erro_testes_unitarios ---
  Using 'UTF-8' encoding to copy filtered resources.
  skip non existing resourceDirectory C:\Users\ruimi\Documents\NetBeansProjects\erro_testes_unitarios\src\main\resources
  
  --- maven-compiler-plugin:3.1:compile (default-compile) @ erro_testes_unitarios ---
  Nothing to compile - all classes are up to date
  
  --- maven-resources-plugin:2.6:testResources (default-testResources) @ erro_testes_unitarios ---
  Using 'UTF-8' encoding to copy filtered resources.
  skip non existing resourceDirectory C:\Users\ruimi\Documents\NetBeansProjects\erro_testes_unitarios\src\test\resources
  
  --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ erro_testes_unitarios ---
  Nothing to compile - all classes are up to date
  
  --- maven-surefire-plugin:2.12.4:test (default-cli) @ erro_testes_unitarios ---
  Surefire report directory: C:\Users\ruimi\Documents\NetBeansProjects\erro_testes_unitarios\target\surefire-reports
  
  -------------------------------------------------------
   T E S T S
  -------------------------------------------------------
  
  Exception in thread "main" java.lang.reflect.InvocationTargetException
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
      at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
  Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
      at org.jacoco.agent.rt.internal_6da5971.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:140)
      at org.jacoco.agent.rt.internal_6da5971.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:101)
      at org.jacoco.agent.rt.internal_6da5971.PreMain.createRuntime(PreMain.java:55)
      at org.jacoco.agent.rt.internal_6da5971.PreMain.premain(PreMain.java:47)
      ... 6 more
  Caused by: java.lang.NoSuchFieldException: $jacocoAccess
      at java.base/java.lang.Class.getField(Class.java:2013)
      at org.jacoco.agent.rt.internal_6da5971.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
      ... 9 more
  *** java.lang.instrument ASSERTION FAILED ***: "result" with message agent load/premain call failed at JPLISAgent.c line: 422
  FATAL ERROR in native method: processing of -javaagent failed, processJavaStart failed
  
  Results :
  
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
  
  ------------------------------------------------------------------------
  BUILD FAILURE
  ------------------------------------------------------------------------
  
  Total time: 2.899 s
  Finished at: 2020-04-10T13:14:06+01:00
  Final Memory: 11M/47M
  
  ------------------------------------------------------------------------
  
  Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-cli) on project erro_testes_unitarios: Execution default-cli of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -&gt; [Help 1]
  
  To see the full stack trace of the errors, re-run Maven with the -e switch.
  Re-run Maven using the -X switch to enable full debug logging.
  
  For more information about the errors and possible solutions, please read the following articles:
  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
  </code></pre>
  
  <p>Here is my pom.xml file: </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
      &lt;artifactId&gt;erro_testes_unitarios&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter-api&lt;/artifactId&gt;
              &lt;version&gt;5.5.2&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter-params&lt;/artifactId&gt;
              &lt;version&gt;5.5.2&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
              &lt;artifactId&gt;junit-jupiter-engine&lt;/artifactId&gt;
              &lt;version&gt;5.5.2&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;maven.compiler.source&gt;14&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;14&lt;/maven.compiler.target&gt;
      &lt;/properties&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.jacoco&lt;/groupId&gt; 
                  &lt;artifactId&gt;jacoco-maven-plugin&lt;/artifactId&gt; 
                  &lt;version&gt;0.7.7.201606060606&lt;/version&gt; 
                  &lt;executions&gt;
                      &lt;execution&gt; 
                          &lt;goals&gt;
                              &lt;goal&gt;prepare-agent&lt;/goal&gt; 
                          &lt;/goals&gt;
                      &lt;/execution&gt; 
                      &lt;execution&gt;
                          &lt;id&gt;report&lt;/id&gt; 
                          &lt;phase&gt;prepare-package&lt;/phase&gt; 
                          &lt;goals&gt;
                              &lt;goal&gt;report&lt;/goal&gt; 
                          &lt;/goals&gt;
                      &lt;/execution&gt; 
                  &lt;/executions&gt;
              &lt;/plugin&gt; 
  
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  
  </code></pre>
  
  <p>Can you help me with this?
  Thank you all for your availability!</p>