Hi Kevin, Thanks for shedding some light on this.
I looked into javafx-graphics-16-win.jar and I can see that vcruntime140.dll and vcruntime140_1.dll are indeed both present. It is not the case however in javafx.graphics.jmod (or any of the jmod files) that are used with jlink, so I suppose this is the root cause for my problem, rather than an issue with loading them. As a side note, "javafx.graphics.jmod" does not contain any of the VS libraries(vcruntime140, msvcp140, api-ms-win-*, etc...) whereas the jar contain them all. I suspect this has not caused any issues so far because OpenJDK already bundles them anyway (with the exception of vcruntime140_1, which is why the issue is now showing). -- Fred ----- Mail original ----- De: "Kevin Rushforth" <kevin.rushfo...@oracle.com> À: "thevenet fred" <thevenet.f...@free.fr>, "openjfx-dev" <openjfx-dev@openjdk.java.net> Envoyé: Mercredi 28 Avril 2021 15:56:13 Objet: Re: JavaFX 16 requires Visual C++ 2019 Redistributable on Windows? Yes, JavaFX 16 uses VS 2019, but those libraries should be distributed as part of the JavaFX 16 bundle. It's possible we have a bug in NaativeLibLoader where they are not getting loaded. -- Kevin On 4/28/2021 6:46 AM, thevenet.f...@free.fr wrote: > Hi, > > I am facing an issue where, after updating to JFX 16, an application fail to > start on Windows machines where the > MS Visual C++ 2019 redistributable libraries are not installed, with the > following exception: > > java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: > C:\binjr-3.0.2-SNAPSHOT_windows-amd64\runtime\bin\glass.dll: Can't find > dependent libraries > at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.startup(Unknown > Source) > at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(Unknown > Source) > at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(Unknown > Source) > at > javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(Unknown > Source) > at > javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown > Source) > at > javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown > Source) > at java.base/java.lang.Thread.run(Unknown Source) > Caused by: java.lang.UnsatisfiedLinkError: > C:\binjr-3.0.2-SNAPSHOT_windows-amd64\runtime\bin\glass.dll: Can't find > dependent libraries > at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) > at > java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown > Source) > at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source) > at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source) > at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(Unknown Source) > at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source) > at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source) > at java.base/java.lang.Runtime.loadLibrary0(Unknown Source) > at java.base/java.lang.System.loadLibrary(Unknown Source) > at > javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(Unknown > Source) > at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(Unknown > Source) > at javafx.graphics/com.sun.glass.ui.Application.loadNativeLibrary(Unknown > Source) > at javafx.graphics/com.sun.glass.ui.Application.loadNativeLibrary(Unknown > Source) > at javafx.graphics/com.sun.glass.ui.win.WinApplication.access$000(Unknown > Source) > at javafx.graphics/com.sun.glass.ui.win.WinApplication$1.run(Unknown Source) > at javafx.graphics/com.sun.glass.ui.win.WinApplication$1.run(Unknown Source) > at java.base/java.security.AccessController.doPrivileged(Unknown Source) > at javafx.graphics/com.sun.glass.ui.win.WinApplication.<clinit>(Unknown > Source) > at > javafx.graphics/com.sun.glass.ui.win.WinPlatformFactory.createApplication(Unknown > Source) > at > javafx.graphics/com.sun.glass.ui.win.WinPlatformFactory.createApplication(Unknown > Source) > at javafx.graphics/com.sun.glass.ui.Application.run(Unknown Source) > ... 7 more > > As previously mentioned, the above exception is not thrown on machines where > the Visual C++ 2019 > redistributable is installed. > > In more details, the application's package is built using OpenJDK 16 and > OpenJFX 16 (x64). > I use jlink to build a runtime image that includes the javaFX modules > (downloaded from Gluon[1]), and > launch the application from the classpath using this image (as the app itself > is not modular). > > An important thing to note, is that the issue does not arise when building > the package using the same > process using JavaFX 15. > > Also,I noticed that the issue does not arise either when I launch the > application using the openJDK 16 > built by Azul that includes JavaFX[2]. From there I tried substituting the > "glass.dll" in my jlink-built runtime > for the onein the Azul distro, and, again, this works. > > Using Dependancy Walker, I then confirmed that "glass.dll" as present in > binairies linked on openjfx.io have > a dependency to VCRUNTIME140_1.DLL whereas the one built by Azul does not. > (Please note the "_1" above; to be quite clear both versions of the dll have > dependency to vcruntime140.dll, > which is bundled with openJDK on Windows, but not vcruntime140_1.dll) > > To be quite honest, I'm not sure this problem has its root in JavaFX's source > code or if it is specific to the JavaFX > binaries built by Gluon or the way I build my application package. > > Thanks in advance for your insights. > > -- Fred > > [1] [ https://gluonhq.com/download/javafx-16-jmods-windows/ | > https://gluonhq.com/download/javafx-16-jmods-windows/ ] > [2] [ > https://www.azul.com/downloads/zulu-community/?version=java-16-sts&os=windows&architecture=x86-64-bit&package=jdk-fx > | > https://www.azul.com/downloads/zulu-community/?version=java-16-sts&os=windows&architecture=x86-64-bit&package=jdk-fx > ] > > >