title: Drools compatibility with Java 11
body: <p>When deploying an ear application containing a drools kie engine 7.20.0.Final on Wildfly 16.0.0.Final, I get a deployment failure exception that sun.reflect.ReflectionFactory class cannot be loaded. The application deploys fine with Java 8.</p>
  
  <p>I understand that Java 11 has removed support for sun.reflect.Reflection. Does drools rely on it? The drools documentation only says the Java requirement is for Java 1.5 and nothing more.</p>
  
  <p>Is drools compatible with Java 11?</p>
  
  <p><strong>Solved.</strong> Turns out the removal of sun.reflect from Java 11 was a red herring. the actual problem was with Wildfly 16 which didn't make the module available. Solution was to create a jboss-deployment-structure.xml as follows:</p>
  
  <pre><code>&lt;jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1"&gt;
      &lt;deployment&gt;
          &lt;dependencies&gt;
              &lt;system export="true"&gt;
                  &lt;paths&gt;
                      &lt;path name="sun/reflect"/&gt;
                  &lt;/paths&gt;
              &lt;/system&gt;
          &lt;/dependencies&gt;
      &lt;/deployment&gt;
  &lt;/jboss-deployment-structure&gt;
  </code></pre>
  
  <p>See this post: <a href="https://stackoverflow.com/questions/51541554/mockito-java-9-and-java-lang-classnotfoundexception-sun-reflect-reflectionfact/51592708#51592708">Mockito, Java 9 and java.lang.ClassNotFoundException: sun.reflect.ReflectionFactory</a></p>