title: What's the difference between --add-exports and --add-opens in Java 9?
body: <p>Java 9 (jdk-9+170) does not allow by default an application to see all classes from the JDK, unlike all previous versions of Java, due to the new module system.</p>
  
  <p>To workaround this, the <code>java</code> command line offers a new argument <code>--add-exports</code> which allows to break encapsulation as follows:</p>
  
  <p><code>java -jar josm.jar --add-exports java.base/sun.security.util=ALL-UNNAMED --add-exports java.base/sun.security.x509=ALL-UNNAMED</code></p>
  
  <p>This is well explained in <a href="http://openjdk.java.net/jeps/261" rel="noreferrer">JEP 261</a>.</p>
  
  <p>I have read about a similar option <code>--add-opens</code> using the same syntax, but the JEP 261 has not yet been updated to describe it (last update: 2017/03/08 13:58).</p>
  
  <p><strong>What is the difference between these two options?</strong></p>
  
  <p><strong>EDIT</strong>: The <a href="http://openjdk.java.net/jeps/261" rel="noreferrer">JEP 261</a> has been updated on 2017-09-22 to explain it.</p>