Open damnms opened 1 year ago
I use gradle and gradle javafx plugin, so i am not 100% sure if this is a problem in https://github.com/openjfx/javafx-gradle-plugin or in graalvm/javafx
When compiling JavaFX application to native image, the org.graalvm.buildtools.native
tool doesn't handle the JavaFX modules properly, resulting in those java.lang.ClassNotFoundException
thrown at runtime. You should use a more specialized tool for producing JavaFX native image: gluonfx
But then, I still get some different runtime exceptions with your app's native image when using the gluonfx
tool. My guess is that the gluonfx
tool somehow doesn't handle the javafx.web
module correctly (missing its OS-native library in the resulting image, for some reason). Perhaps you should replace the use of javafx.web
module in your app (e.g. replacing the usage of WebView class), to see if it helps?
I have the same issue with graalvm v 17.x, but i it worked in previous version that i have been deleted. I think 19.x with OpenJDK 11.x. I hope somebody would fix it or find somehow solution
i am not affected by this anymore because i left graalvm (because of such problems) and went the jpackage approach, but i leave this ticket open for others that are affected.
Hello @kamel2005 and @kamel2005, can you please share the exact steps we need to take to get that error, including a reproducer? And just to be sure, @kamel2005 mentioned that this was not a problem on previous versions of GraalVM, can you please share the version that can work with your project?
1) Run the application with the tracing agent enabled: java -cp "lib" -p "lib" --add-modules ALL-MODULE-PATH -agentlib:native-image-agent=config-output-dir=META-INF/native-image -jar yourapp.jar.jar
2) Generate Native Image
native-image --no-fallback --link-at-build-time --enable-all-security-services -H:ReflectionConfigurationFiles="META-INF\native-image\reflect-config.json -H:+TraceSecurityServices -H:+ReportExceptionStackTraces --verbose -H:Log=registerResource:3 -H:Name=SecureNote-1.0 -H:Class=com.yourpackagename.MainApp -cp lib1.jar; lib2.jar ... ; yourapp.jar
Note: replace with your jar, lib and package names
As I mentioned in my previous post, I don't remember the exact versions that worked before neither i have any of these versions.
i have an application (https://gitlab.com/olze/chatclient) that i'd like to move to a native image. the build works but when i execute it, i get an error: