Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaFX on Windows crashes if there's a "glass.dll" in PATH #1190

Open
Lilianne-Blaze opened this issue Nov 26, 2022 · 2 comments
Open

JavaFX on Windows crashes if there's a "glass.dll" in PATH #1190

Lilianne-Blaze opened this issue Nov 26, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@Lilianne-Blaze
Copy link

Compiling HelloFX examples using
JAVA_HOME=C:\Program Files\BellSoft\LibericaJDK-17-Full
GRAALVM_HOME=c:\Program Files\Java\graalvm-svm-java17-windows-gluon-22.1.0.1-Final
PATH=C:\Tools\Path;C:\Program Files\BellSoft\LibericaJDK-17-Full\bin[...]
<javafx.maven.plugin.version>0.0.8</javafx.maven.plugin.version>
<gluonfx.maven.plugin.version>1.0.16</gluonfx.maven.plugin.version>

(Note "-Full" suffix means it has JavaFX baked in)

Tried with javafxStaticSdkVersion versions 17, 19 and 20 with the same results.
Compiles without errors.

When started using gluonfx:nativerun it starts and fails with:
[Sat [removed date+time][[INFO] [SUB] [removed time] [main] WARN hellofx.HelloFX - random log text to check if it's starting at all
[Sat [removed date+time]][INFO] [SUB] WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @6b71769e'
[Sat [removed date+time]][FINE] Result for run until end: -1073741819
[Sat [removed date+time]][SEVERE] Process run until end failed with result: -1073741819

Note -1073741819 is 0xc0000005 = access violation
(Suggestion - why not print it in hex?)

According to report.wer file in
c:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_HelloFX.exe_[hex digits]
it tries to load
LoadedModule[47]=C:\Program Files\BellSoft\LibericaJDK-17-Full\bin\prism_d3d.dll
LoadedModule[63]=C:\Program Files\BellSoft\LibericaJDK-17-Full\bin\glass.dll
(The rest are from C:\Windows... )
Which it obviously shouln't?
Glass.lib is linked statically, isn't it, so why should it look for glass.dll at all?

Now trying to open a command prompt where hellofx.exe is.

Running hellofx.exe:
No output, crashes immidiately

Same command prompt, running "set path=", running hello.exe
Starts as intended - shows a window with Duke and Java version

Running "set path=%java_home%\bin" - so only Liberica-17-Full is in it, running hello.exe again
Again no output, crashes immidiately

Obviously, having to modify / check PATH for existing Java installations defeats the purpose of having a self-contained exe. For an "average user" it would be a very big problem, especially if they already have some non-native Java software installed.

@Lilianne-Blaze Lilianne-Blaze added the bug Something isn't working label Nov 26, 2022
@kristofdho
Copy link
Contributor

For reference, sounds similar to #940

@Lilianne-Blaze
Copy link
Author

For reference, sounds similar to #940

Thanks, adding
System.setProperty("java.library.path", "runtime\bin;runtime\lib");
near the start of main() helped, it's working as intended now.

Obviously a more complete workaround could check which directories in "java.library.path" contain "glass.dll" and remove those while preserving the rest.

https://github.com/gluonhq/scenebuilder/pull/358/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants