title: Fixing module {a} does not "opens {package}" to module {B} in Eclipse
body: <p>The error <code>module {a} does not &quot;opens {package}&quot; to module {B}</code> has been asked before, where an <a href="https://stackoverflow.com/questions/41265266/how-to-solve-inaccessibleobjectexception-unable-to-make-member-accessible-m">explanation and solution was provided</a>.</p>
  <p>The solution was to add the following <code>--add-opens</code> VM argument to the command line when running the jar file like so:
  <code>java -jar --add-opens=java.base/java.lang=ALL-UNNAMED some_jar_file.jar</code></p>
  <p>I have a JavaFX program running <code>Java-11.0.6</code> and <code>javafx-sdk-14</code>, built in <code>Eclipse Version: 2019-09 R (4.13.0)</code>. When I export my project as a runnable jar file, the aforementioned fix works when I run the jar file from command prompt.</p>
  <p>However, when I try to apply the VM argument fix to Eclipse so that I can run my program inside of Eclipse, I get the original <code>module {a} does not &quot;opens {package}&quot; to module {B}</code> error:</p>
  <p><a href="https://i.stack.imgur.com/4Inyy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4Inyy.png" alt="enter image description here" /></a></p>
  <p>Am I misunderstanding the fix, using eclipse VM arguments incorrectly, or is it an issue with Eclipse? My company has the 2020-06 version of Eclipse that I could try, but since modules were introduce in Java9 years ago, I doubt it will help.</p>
  <p><em>Note</em>: I've made sure my Eclipse is configured to use Java 11 as its VM:</p>
  <p><a href="https://i.stack.imgur.com/cp3AB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cp3AB.png" alt="enter image description here" /></a></p>
  <p><strong>Edit 1</strong>: My command line from Eclipse is as follows: <code>C:\Program Files\Java\jdk-11.0.6\bin\javaw.exe --add-opens=java.base/java.lang=ALL-UNNAMED -Dfile.encoding=Cp1252 -p &quot;C:\Users\BL89306\eclipse-workspace\cto_emi_aat\bin;C:\Program Files\Java\javafx-sdk-14\lib\javafx.base.jar;C:\Program Files\Java\javafx-sdk-14\lib\javafx.controls.jar;C:\Program Files\Java\javafx-sdk-14\lib\javafx.fxml.jar;C:\Program Files\Java\javafx-sdk-14\lib\javafx.graphics.jar;C:\Program Files\Java\javafx-sdk-14\lib\javafx.media.jar;C:\Program Files\Java\javafx-sdk-14\lib\javafx.swing.jar;C:\Program Files\Java\javafx-sdk-14\lib\javafx.web.jar;C:\Program Files\Java\javafx-sdk-14\lib\javafx-swt.jar;C:\Users\BL89306\eclipse-workspace\cto_emi_aat\lib\com.ibm.mq.allclient-9.2.0.1.jar;C:\Users\BL89306\eclipse-workspace\cto_emi_aat\lib\gson-2.8.6.jar;C:\Users\BL89306\eclipse-workspace\cto_emi_aat\lib\ikonli-javafx-11.3.5-sources.jar;C:\Users\BL89306\eclipse-workspace\cto_emi_aat\lib\ikonli-javafx-11.3.5.jar;C:\Program Files\Microsoft JDBC DRIVER 6.0 for SQL Server\sqljdbc_6.0\enu\jre8\sqljdbc42.jar;C:\Users\BL89306\eclipse-workspace\cto_emi_aat\lib\jaxb-api-2.3.1.jar&quot; -m AAT/com.thehartford.aat.gui.AATApp</code></p>