title: Any idea how to fix this? Exception in thread "WindowsNativeRunloopThread" java.lang.NoSuchMethodError
body: <p>My application uses javafx 11.0.1 and is shipped bundled with a jlinked version of openjdk 11. It runs fine for the vast majority of the users but few of them are getting this stack:</p>
  
  <pre><code>Exception in thread "WindowsNativeRunloopThread" java.lang.NoSuchMethodError: &lt;init&gt;
          at com.sun.glass.ui.win.WinApplication.staticScreen_getScreens(Native Method)
          at com.sun.glass.ui.Screen.initScreens(Screen.java:412)
          at com.sun.glass.ui.Application.lambda$run$1(Application.java:152)
          at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
          at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
          at java.base/java.lang.Thread.run(Unknown Source)
  Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
          at com.sun.javafx.tk.quantum.QuantumToolkit.assignScreensAdapters(QuantumToolkit.java:695)
          at com.sun.javafx.tk.quantum.QuantumToolkit.runToolkit(QuantumToolkit.java:313)
          at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$startup$10(QuantumToolkit.java:258)
          at com.sun.glass.ui.Application.lambda$run$1(Application.java:153)
          at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
          at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
          at java.base/java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>I found some discussion related to the same exception but regarding Maven+Eclipse, <a href="https://www.mail-archive.com/openjfx-dev@openjdk.java.net/msg14667.html" rel="nofollow noreferrer">here</a> and <a href="https://stackoverflow.com/questions/52906570/javafx-11-using-maven-throws-exception-windowsnativerunloopthread">here</a>. The issue is very similar, user reporting it, do have other java installations and uninstalling them solves the issue, so basically leaving my bundled openjdk as the only option the application starts, but if there is another Java installed on the system, the wrong .dll is picked up and the application crashes with the above stacktrace.</p>
  
  <p>I tried the suggested <code>java.library.path</code> workaround but users are saying it doesn't solve. Unfortunately I cannot reproduce it myself, any idea on how to solve it or what to ask the users reporting it?</p>
  
  <p><strong>EDIT</strong>: we fixed the exe generated by lauch4j <a href="https://github.com/torakiki/pdfsam/commit/a729b6213ed12a9933855766e8f0f3f3549cb6dd" rel="nofollow noreferrer">here</a> and the bash script <a href="https://github.com/torakiki/pdfsam/issues/357" rel="nofollow noreferrer">here</a>. The idea is basically to restrict/change the <code>PATH</code> env variable to avoid the wrong dll being picked up. </p>