2

IDE: Eclipse with Gradle

Language: Java

JDK:adoptOpenJDK 11.0.5+x

Exception in thread "WindowsNativeRunloopThread" java.lang.NoSuchMethodError: <init>
    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(Thread.java:834)
Exception in thread "WindowsNativeRunloopThread" java.lang.NoSuchMethodError: <init>
    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(Thread.java:834)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at com.sun.prism.d3d.D3DPipeline.getAdapterOrdinal(D3DPipeline.java:205)
    at com.sun.javafx.tk.quantum.QuantumToolkit.assignScreensAdapters(QuantumToolkit.java:738)
    at com.sun.javafx.tk.quantum.QuantumToolkit.runToolkit(QuantumToolkit.java:334)
    at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$startup$10(QuantumToolkit.java:279)
    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(Thread.java:834)

We had a java-product which was not developed in gradle. After most of development was finished we added gradle to the project. Naturally we had to change how to implement the librarys. Now, we have also changed the java version on adoptOpen-JDK. And when I try to run this project I'm getting the error above.

We have added things like:

plugins {
    id 'eclipse'
    id 'eclipse-wtp'
    // Apply the java plugin to add support for Java
    id 'java'

    // Apply the application plugin to add support for building a CLI application
    id 'application'

    id 'org.openjfx.javafxplugin' version '0.0.8'
}


dependencies {
    implementation project(":gradle_somePrivate_lib")
    // This dependency is used by the application.
    compile 'org.controlsfx:controlsfx:11.0.0'

}

javafx {
    version = "12"
    modules = [ 'javafx.controls', 'javafx.fxml']
    mainClassName = 'someName'
}

But its not working.

-Djava.library.path=C:/anywhere-outside-eclipse did not solve this problem for me.

UPDATE

This solved my problem: https://stackoverflow.com/a/54828325/8547783

Jane_Doe
  • 121
  • 7
  • Have you checked the `NullPointerException` at `D3DPipeline.java:205`? It might be indicating at JavaFX versioning issue. – Boris Jan 27 '20 at 14:38
  • If I click on the exception I'm getting: `205 is not a valid line number in com.sun.prism.d3d.D3DPipeline` – Jane_Doe Jan 27 '20 at 14:42
  • What's the JavaFX version you use? – Boris Jan 27 '20 at 14:56
  • 2
    I guess you have tried all the possible workarounds mentioned in this question: https://stackoverflow.com/questions/52906570/javafx-11-using-maven-throws-exception-windowsnativerunloopthread? – José Pereda Jan 27 '20 at 15:31
  • I did try all the popular answers and they did not help me. I tried the unpopular answers right now and it worked: https://stackoverflow.com/a/54828325/8547783 – Jane_Doe Jan 28 '20 at 06:49

0 Answers0