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

native image program in AWT-WINDOWS cannot be renamed #3

Open
java71 opened this issue Jan 21, 2024 · 3 comments
Open

native image program in AWT-WINDOWS cannot be renamed #3

java71 opened this issue Jan 21, 2024 · 3 comments

Comments

@java71
Copy link

java71 commented Jan 21, 2024

Context use
-LIBERICA for java21
-OS WINDOWS
-Application based on AWT for processing images

First, it seems impossible to build a static executable (no AWT in java library path) !
So I had to back up on dynamic build.
My program is correctly built with a lot of DLL in the same directory
For testing it, I open a "DOS like" CONSOLE.
-When executing generated program -> OK it works (except a segmentation fault on System.exit(0)) !!!
-But when renaming program (simply append a character to the name for instance), execution cannot be started -> "No awt in java.library.path"

Could you please:

  • Tell me if you can reproduce this problem (simply rename your generated program)
  • Confirm that building static executable based on AWT techno is possible or not
  • And if not, tell me if ORACLE/LIBERICA is working for generating AWT static executable (like JavaFX) on WINDOWS

Thanks!

@petermz
Copy link
Collaborator

petermz commented Jan 22, 2024

Hi,

I can confirm the renamed program stops working, for reasons so far unclear to me. Thanks for reporting this!

System.exit() worked for me. Could you post your crash dump maybe?

On Windows, AWT libraries were linked dynamically for a long time, probably from the very beginning. Linux did static linking for some time, then converted to dynamic linking as well. This issue has some details. So it's the other way around -- we'll probably have more dynamic and less static linking over time.

@java71
Copy link
Author

java71 commented Jan 23, 2024 via email

@bell-sw bell-sw transferred this issue from bell-sw/Liberica Feb 21, 2024
@Lilianne-Blaze
Copy link

Lilianne-Blaze commented Feb 21, 2024

@java71
GraalVM generates shim dlls with hardcoded exe name.
I've managed to create a workaround but I must warn you it's a bit of a sxxxshow and I don't have the time now to clean it up. It extracts and modifies shims and other dlls as needed.
https://github.com/Lilianne-Blaze/demo-nativeimage-swing2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants