title: Maven error Cannot access defaults field of Properties
body: <p>I use the newest version of Java -&gt; 16. When I run mvn clean, I am getting <em><strong>Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer</strong></em> error. I read that adding maven-war-plugin can be a solution, but it didn't work for me. When I run mvn install, the following error occurs:</p>
  <blockquote>
  <p>Error injecting constructor, java.lang.ExceptionInInitializerError:
  <strong>Cannot access defaults field of Properties   at</strong>
  org.apache.maven.plugin.war.WarMojo.(Unknown Source)   while
  locating org.apache.maven.plugin.war.WarMojo</p>
  </blockquote>
  <p>How can I solve these problems? Are they caused by the Java version?
  </p>
  <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;web-programming&lt;/groupId&gt;
  &lt;artifactId&gt;servlet-demo&lt;/artifactId&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
  &lt;properties&gt;
      &lt;java.version&gt;16&lt;/java.version&gt;
      &lt;maven.compiler.target&gt;${java.version}&lt;/maven.compiler.target&gt;
      &lt;maven.compiler.source&gt;${java.version}&lt;/maven.compiler.source&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
          &lt;version&gt;3.1.0&lt;/version&gt;
          &lt;scope&gt;provided&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.1.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;!-- Optional. Allows the app to be run by simply typing mvn jetty:run --&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jetty-plugin&lt;/artifactId&gt;
              &lt;version&gt;6.1.4&lt;/version&gt;
              &lt;dependencies&gt;
                  &lt;dependency&gt;
                      &lt;groupId&gt;log4j&lt;/groupId&gt;
                      &lt;artifactId&gt;log4j&lt;/artifactId&gt;
                      &lt;version&gt;1.2.13&lt;/version&gt;
                  &lt;/dependency&gt;
              &lt;/dependencies&gt;
              &lt;configuration&gt;
                  &lt;contextPath&gt;/&lt;/contextPath&gt;
                  &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
                  &lt;connectors&gt;
                      &lt;connector
                          implementation=&quot;org.mortbay.jetty.nio.SelectChannelConnector&quot;&gt;
                          &lt;port&gt;9090&lt;/port&gt;
                      &lt;/connector&gt;
                  &lt;/connectors&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.2&lt;/version&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>