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

Maven native build proposal #93

Open
charizardmatok opened this issue Aug 23, 2024 · 4 comments
Open

Maven native build proposal #93

charizardmatok opened this issue Aug 23, 2024 · 4 comments

Comments

@charizardmatok
Copy link

Could the library be adapted to work in maven native build?
Currently it's not working due to java.awt not being fully supported:
org.jboss.resteasy.spi.UnhandledException: java.lang.InternalError: java.lang.ClassNotFoundException: sun.awt.X11FontManager

@manuelbl
Copy link
Owner

Do you mean a build for GraalVM?

The backend of the demo application for the library (https://github.com/manuelbl/SwissQRBillDemo/tree/master, published at https://www.codecrete.net/qrbill/) actually uses a native build. It is built on top of the Quarkus framework.

AWT is known to be a challenge with GraalVM. The Quarkus people built a special addition that takes care of it. In the demo application, it's configured here: https://github.com/manuelbl/SwissQRBillDemo/blob/master/service/pom.xml#L54

If you are also using Quarkus, that should help. If you don't use it, the extension might help you to understand what's needed to get it running.

@charizardmatok
Copy link
Author

Exactly, GraalVM build. I am running quarkus also. I believe I once tried to use quarkus-awt dependency to bypass this, but it resulted in the same error. I will try it again just for good measure.

@manuelbl
Copy link
Owner

You might want to look at this commit. It contains the relevant changes. The changes for Java classes in the namespace net.codecrete.qrbill.web... are relevant for the demo application only and not for the library in general.

@charizardmatok
Copy link
Author

Yes, I understand that, and I tried it following the changes made in the provided commit, but I am still getting an issue with a bunch of classes being inited at build time instead of runtime.
Error: Classes that should be initialized at run time got initialized during image building: ...

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

2 participants