JDK-8246796 : glass.dll of locally installed JRE is used instead
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: openjfx11
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2020-06-05
  • Updated: 2020-06-18
  • Resolved: 2020-06-18
Related Reports
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
Only tested on windows until know

A DESCRIPTION OF THE PROBLEM :
When starting a Java 11 / JavaFX 11 application the following exception will be thrown and the application stops:

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

From my point of view this is based on the internal usage of a wrong glass.dll. If an old Oracle JRE 8 is installed in the windows system the "bin" folder of that JRE is part of the windows PATH environment. Since this folder contains the old glass.dll of the Java 8 JRE it is used in the Java 11 application instead of the glass.dll that is part of the JavaFX 11 jars. 
More information can be found here:  https://github.com/karakun/OpenWebStart/issues/125
Some other people had the same problem: https://stackoverflow.com/questions/52906570/javafx-11-using-maven-throws-exception-windowsnativerunloopthread

Maybe it would make sense to add a version information to the dll files of JavaFX starting with the next release.

REGRESSION : Last worked in version 8u251

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Install a Oracle 8 JRE on a windows system and check that the "bin" folder of the JRE in on the PATH.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Application should start normally
ACTUAL -
Exception as described

CUSTOMER SUBMITTED WORKAROUND :
Deinstall the Java 8 JRE or remove it from the PATH

FREQUENCY : always



Comments
This is a duplicate of JDK-8223746
18-06-2020