Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8281089

JavaFX built with VS2019 and jlinked into JDK 11.x fails to start

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • jfx19
    • jfx11, jfx17
    • javafx

        To reproduce this, run the following on a Windows machine that does *not* have the Visual Studio runtime libraries installed in C:\Windows\System32. In particular, make sure that C:\Windows\System32\vcruntime140_1.dll does not exist.

        1. Use a JDK 11.0.x release built with VS 2017

        2. Use a recent version of the JavaFX jmods built with VS 2019 (e.g., JavaFX 17.0.2)

        3. Create a jlinked image as follows:

        $ jlink --module-path ./javafx-jmods-17.0.2 --add-modules java.se,javafx.controls --bind-services --output ./jdk-11+fx

        4. Run any JavaFX program using the custom. jlinked JDK:

        $ jdk-11+fx/bin/java -Djavafx.verbose=true -Dprism.verbose=true HelloRectangle

        BUG: it will print the following exceptions and fail to start:

        JavaFX launchApplication method: launchMode=LM_CLASS
        Loaded jdk-11+fx\bin\api-ms-win-core-console-l1-1-0.dll from java.library.path
        Error: failed to load api-ms-win-core-console-l1-2-0.dll : java.lang.UnsatisfiedLinkError: no api-ms-win-core-console-l1-2-0 in java.library.path:
        ...
        Loaded jdk-11+fx\bin\vcruntime140.dll from java.library.path
        Error: failed to load vcruntime140_1.dll : java.lang.UnsatisfiedLinkError: no vcruntime140_1 in java.library.path:
        Loaded jdk-11+fx\bin\msvcp140.dll from java.library.path
        ...
        GraphicsPipeline.createPipeline failed for com.sun.prism.d3d.D3DPipeline
        java.lang.UnsatisfiedLinkError: jdk-11+fx\bin\prism_d3d.dll: Can't find dependent libraries
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2638)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:829)
        at java.base/java.lang.System.loadLibrary(System.java:1867)
        at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:166)
        at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:54)
        at javafx.graphics/com.sun.prism.d3d.D3DPipeline.lambda$static$0(D3DPipeline.java:54)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.prism.d3d.D3DPipeline.<clinit>(D3DPipeline.java:50)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
        at java.base/java.lang.Thread.run(Thread.java:834)
        *** Fallback to Prism SW pipeline
        Prism pipeline name = com.sun.prism.sw.SWPipeline
        Loaded jdk-11+fx\bin\prism_sw.dll from java.library.path
        (X) Got class = class com.sun.prism.sw.SWPipeline
        Initialized prism pipeline: com.sun.prism.sw.SWPipeline
        JavaFX: using com.sun.javafx.tk.quantum.QuantumToolkit
        Error: failed to load api-ms-win-core-console-l1-2-0.dll :
        Error: failed to load vcruntime140_1.dll : java.lang.UnsatisfiedLinkError: no vcruntime140_1 in java.library.path:
        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: java.lang.UnsatisfiedLinkError: jdk-11+fx\bin\glass.dll: Can't find dependent libraries
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:301)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:293)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
        ... 5 more
        Caused by: java.lang.UnsatisfiedLinkError: jdk-11+fx\bin\glass.dll: Can't find dependent libraries
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2638)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:829)
        at java.base/java.lang.System.loadLibrary(System.java:1867)
        at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:166)
        at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:54)
        at javafx.graphics/com.sun.glass.ui.Application.loadNativeLibrary(Application.java:112)
        at javafx.graphics/com.sun.glass.ui.Application.loadNativeLibrary(Application.java:120)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.access$000(WinApplication.java:43)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication$1.run(WinApplication.java:107)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication$1.run(WinApplication.java:88)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication.<clinit>(WinApplication.java:88)
        at javafx.graphics/com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatformFactory.java:39)
        at javafx.graphics/com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatformFactory.java:36)
        at javafx.graphics/com.sun.glass.ui.Application.run(Application.java:146)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:291)
        ... 10 more

              kcr Kevin Rushforth
              kcr Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: