title: java throws InvalidModuleDescriptorException when module exports patched package
body: <p><code>java</code> 10.0.2+13 throws a <code>java.lang.module.InvalidModuleDescriptorException</code> when a <code>module-info.class</code> in a directory in the module path exports a package that isn't under the same directory.</p>
  
  <p>That is sensible behavior in many circumstances, but, in my case, I have the package under another directory which is patched into the module in question using <code>--patch-module</code>.</p>
  
  <p><strong>Example:</strong></p>
  
  <p>Module <code>m</code> is defined in file <code>classes/m/module-info.class</code>.</p>
  
  <p><code>m</code> exports package <code>p</code>.</p>
  
  <p><code>module-info.class</code> is the only child of directory <code>classes/m</code>.</p>
  
  <p>Directory <code>classes/patch</code> contains <code>p/Main.class</code>.</p>
  
  <p>Simplified command line:</p>
  
  <pre><code>java --module-path classes/m --patch-module m=classes/patch --module m/p.Main
  </code></pre>
  
  <p>The above will throw a <code>java.lang.module.InvalidModuleDescriptorException</code> that says that "Package p not found in module".</p>
  
  <p>Is there any way to get <code>java</code> to not throw an <code>InvalidModuleDescriptorException</code>, without having to copy the <code>class</code> files from <code>classes/m</code> &amp; <code>classes/patch</code> into the same directory, or into the same <code>jar</code> file?</p>