I'm trying to generate the Windows bundle of my JavaFX application using JPackage. I'm running on Liberica JDK 19 and my scripts first generate a runtime using JLink with a --vm=client
argument and then they run jpackage with a --runtime-image
pointing to the generated image.
Everything runs fine when I launch the application generated by jpackage using a .bat script, but when I run the the generated .exe I get an error and, looking at the debug information, it seems the .exe is loading the jvm.dll from the runtime\bin\server
instead of the runtime\bin\client
folder:
[TRACE] app.cpp:123: Entering app::launch
[TRACE] AppLauncher.cpp:116: Launcher config file path: "C:\delete\pdfsam-5.0.0-SNAPSHOT-windows\pdfsam\app\pdfsam.cfg"
[TRACE] JvmLauncher.cpp:44: Jvm(000001319907E960)::Jvm()
[TRACE] AppLauncher.cpp:76: Property "app.runtime" not found in "Application" section of launcher config file. Using Java runtime from "C:\delete\pdfsam-5.0.0-SNAPSHOT-windows\pdfsam\runtime" directory
[TRACE] JvmLauncher.cpp:49: Jvm(000001319907E960)::~Jvm()
[TRACE] app.cpp:123: Entering app::launch
[TRACE] AppLauncher.cpp:116: Launcher config file path: "C:\delete\pdfsam-5.0.0-SNAPSHOT-windows\pdfsam\app\pdfsam.cfg"
[TRACE] JvmLauncher.cpp:44: Jvm(00000200C91AE310)::Jvm()
[TRACE] AppLauncher.cpp:76: Property "app.runtime" not found in "Application" section of launcher config file. Using Java runtime from "C:\delete\pdfsam-5.0.0-SNAPSHOT-windows\pdfsam\runtime" directory
[TRACE] WinLauncher.cpp:216: SetDllDirectory to: C:\delete\pdfsam-5.0.0-SNAPSHOT-windows\pdfsam\runtime\bin
[TRACE] WinLauncher.cpp:73: Entering `anonymous-namespace'::loadDllWithAddDllDirectory
[TRACE] WinLauncher.cpp:89: AddDllDirectory(C:\delete\pdfsam-5.0.0-SNAPSHOT-windows\pdfsam\runtime\bin): OK
[TRACE] WinLauncher.cpp:97: LoadLibraryEx(C:\delete\pdfsam-5.0.0-SNAPSHOT-windows\pdfsam\runtime\bin\jli.dll, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS): 00007FFCCB100000
[TRACE] WinLauncher.cpp:0: Exiting `anonymous-namespace'::loadDllWithAddDllDirectory (entered at WinLauncher.cpp:73)
[TRACE] WinLauncher.cpp:73: Entering `anonymous-namespace'::loadDllWithAddDllDirectory
[TRACE] WinLauncher.cpp:0: Exiting `anonymous-namespace'::loadDllWithAddDllDirectory (entered at WinLauncher.cpp:73)
[TRACE] WinLauncher.cpp:52: Entering `anonymous-namespace'::loadDllWithAlteredPATH
[TRACE] WinLauncher.cpp:62: New value of PATH: SOME PATH HERE;C:\delete\pdfsam-5.0.0-SNAPSHOT-windows\pdfsam\app;C:\delete\pdfsam-5.0.0-SNAPSHOT-windows\pdfsam\runtime\bin\server
[TRACE] WinLauncher.cpp:0: Exiting `anonymous-namespace'::loadDllWithAlteredPATH (entered at WinLauncher.cpp:52)
[TRACE] JvmLauncher.cpp:49: Jvm(00000200C91AE310)::~Jvm()
[ERROR] app.cpp:179: Exception with message 'WinDll.cpp(40) at `anonymous-namespace'::loadLibrary(): LoadLibraryW(C:\delete\pdfsam-5.0.0-SNAPSHOT-windows\pdfsam\runtime\bin\server\jvm.dll) failed. System error [126](system error 126 (Impossibile trovare il modulo specificato))' caught
LoadLibraryW(C:\delete\pdfsam-5.0.0-SNAPSHOT-windows\pdfsam\runtime\bin\server\jvm.dll) failed. System error [126](system error 126 (Impossibile trovare il modulo specificato))
[TRACE] app.cpp:0: Exiting app::launch (entered at app.cpp:123)
Any idea what I might be doing wrong?