title: Java 11 compile error: Package xxx exists in another module
body: <p>There is a class in my project. This class in package javax.swing extends javax.swing.JOptionPane because I want to use some protected methods of JOptionPane. </p>
  
  <p>When the compiler is JDK 8 it works fine. I update the JDK version to 11 then I've got a compile error: Package 'javax.swing' exists in another module: java.desktop.</p>
  
  <p>My IDE is Intellij idea. I opened the Settings--Build,Execution,Deployment--Java Compiler and added an item to 'Override compiler parameters pre-module'. The Module is my project. The compilation options is</p>
  
  <pre><code>--patch-module java.desktop=src -d mypatches/java.desktop/src/java.desktop/javax/swing/Top.java
  </code></pre>
  
  <p>But it does not work.</p>
  
  <p>My project tree is 'GreatProject/src/javax/swing/Top.java'.</p>
  
  <p>What's the 'src -d' means?</p>
  
  <p>What's the right '--patch-module'?</p>