openjfx / javafx-gradle-plugin

Gradle plugin that makes it easy to work with JavaFX 11+
https://openjfx.io/
BSD 3-Clause "New" or "Revised" License
361 stars 62 forks source link

Exception in thread "WindowsNativeRunloopThread" java.lang.NoSuchMethodError: <init> #57

Closed utybo closed 5 years ago

utybo commented 5 years ago

This issue happens when running the non-modular sample for IntelliJ when running gradle run inside IntelliJ.

JDK 12 (AdoptOpenJDK 12.0.2 with HotSpot)

Exception in thread "WindowsNativeRunloopThread" java.lang.NoSuchMethodError: <init>
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.staticScreen_getScreens(Native Method)
    at javafx.graphics/com.sun.glass.ui.Screen.initScreens(Screen.java:412)
    at javafx.graphics/com.sun.glass.ui.Application.lambda$run$1(Application.java:152)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:835)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at javafx.graphics/com.sun.prism.d3d.D3DPipeline.getAdapterOrdinal(D3DPipeline.java:205)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.assignScreensAdapters(QuantumToolkit.java:738)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runToolkit(QuantumToolkit.java:334)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$startup$10(QuantumToolkit.java:279)
    at javafx.graphics/com.sun.glass.ui.Application.lambda$run$1(Application.java:153)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:835)

My guess is that the DLLs included in the platform dependencies are not getting loaded for some reason.

Edit: I have also created an issue on IntelliJ IDEA's bug tracker just in case the issue comes from their end https://youtrack.jetbrains.com/issue/IDEA-219912

jperedadnr commented 5 years ago

There is a documented issue: https://openjfx.io/openjfx-docs/#IDE-Eclipse, section Non-modular with Gradle/4. Run project. The same is documented for Maven projects.

The issue is also documented here: https://stackoverflow.com/questions/52906570/javafx-11-using-maven-throws-exception-windowsnativerunloopthread

where it is notified that the issue happens also using IntelliJ.

I guess you should add these details to your IDEA issue.

Anyway, this is not an issue of the plugin, but mainly an IDE issue, so feel free to close it.

utybo commented 5 years ago

Thank you, I somehow missed the first link while looking for a solution. I have added all of that to the IDEA issue.

utybo commented 5 years ago

For the record, this is entirely fixed in IntelliJ IDEA 2019.2