title: JavaFX program does not run when VM Options set to one directory, but runs fine when set to another directory with the same files
body: <p>I have a project in IntelliJ (Java 11) containing two modules. One is a simple java module and the other is a JavaFX program. These are both empty as I am setting up the project structure for use on Git and am trying to get rid of any absolute file paths.</p>
  
  <p>At the root of the project is a lib folder that contains all of the JARs for JavaFX (plus some others for JUnit). These were copied directly from the folder I originally extracted JavaFX to (and which I still use fine when building non-Git JavaFX projects) when I first used the framework.</p>
  
  <p>I have these JARs added as dependencies in the project. Any code using them shows with no errors in the IDE. I know that to get the JavaFX project to run I must add <code>--module-path &lt;path to JavaFX libs&gt; --add-modules=javafx.controls,javafx.fxml</code> to the VM options in my run configuration. This is where the problem is.</p>
  
  <p>When I use the path to the original extraction location of JavaFX I was talking about earlier, everything works fine (i.e. the window of the program opens): <code>--module-path C:/Tools/JavaFX/lib/ --add-modules=javafx.controls,javafx.fxml</code>.</p>
  
  <p>However, when I use the path to the lib folder in my project that contains the same files (plus JUnit ones), it does not work (I get runtime errors and the program does not display its window): <code>--module-path C:/Users/Henry/Documents/IntelliJ/LAA_Rotas_4/lib/ --add-modules=javafx.controls,javafx.fxml</code></p>
  
  <p>Below is the runtime output:</p>
  
  <pre><code>"C:\Program Files\Java\jdk-11\bin\java.exe" --module-path C:/Users/Henry/Documents/IntelliJ/LAA_Rotas_4/lib/ --add-modules=javafx.controls,javafx.fxml "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\lib\idea_rt.jar=57474:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.2.4\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\out\production\Demo;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\apiguardian-api-1.0.0.jar;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\javafx-swt.jar;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\javafx.base.jar;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\javafx.controls.jar;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\javafx.fxml.jar;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\javafx.graphics.jar;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\javafx.media.jar;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\javafx.swing.jar;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\javafx.web.jar;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\junit-jupiter-api-5.3.1.jar;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\junit-platform-commons-1.3.1.jar;C:\Users\Henry\Documents\IntelliJ\LAA_Rotas_4\lib\opentest4j-1.1.1.jar net.atos.laa_rotas.demo.Main
  Graphics Device initialization failed for :  d3d, sw
  Error initializing QuantumRenderer: no suitable pipeline found
  java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:222)
      at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
  Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
      at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
      at java.base/java.lang.Thread.run(Thread.java:834)
  Exception in thread "main" java.lang.reflect.InvocationTargetException
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
  Caused by: java.lang.RuntimeException: No toolkit found
      at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
      at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
      at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
      ... 5 more
  
  Process finished with exit code 1
  </code></pre>
  
  <p>Internally, in the workspace.xml file for IntelliJ, those VM options get converted to <code>--module-path $PROJECT_DIR$/lib/ --add-modules=javafx.controls,javafx.fxml</code>. However, even if I directly set that path to <code>C:/Users/Henry/Documents/IntelliJ/LAA_Rotas_4/lib/</code> in the workspace.xml file and reload and run the project, nothing changes.</p>
  
  <p>Does anyone know why this is happening and what can be done to fix it?</p>