-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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] Native image of JavaFX application can not run #403
Comments
It looks like this problem exists for all JavaFX apps GraalVM, when I tried to deal with this demo, they also failed for the same reason. |
@Glavo thank you for your report. We haven't tried running JavaFX apps so far. We'll look into it. |
For cross refer #358 |
Any news? |
3 similar comments
Any news? |
Any news? |
Any news? |
Any news please. |
Hi folks: For JavaFX 11 , you probably don't need native image since you could use jlink to create your own customized runtime which is relatively small and JavaFX is distributed in jmods which can be used to create your own java runtime, so maybe keep a runtime is a better idea rather than compile the whole program into native:) Hope it helps |
Compile the whole program into native in some situations protect the code speeds start up and running the program faster and reduce memory . |
@chengenzhao The JavaFX application I am developing is for Java developers, so I don't need to use jlink to package the entire runtime environment. My goal is to reduce the memory consumption and reduce the startup time of the application through Graal. I have tried to compile my application to native using ExcelsiorJET, and ExcelsiorJET successfully reduced 90% of startup time and 50% of memory usage. |
Managed to make it build, but doesn't run properly: #994 |
Is this project dead? I guess React is the way to go for native ui... |
@ssmooncoder You must be confused, nobody ever suggested that GraalFX JavaFX (JavaFXPorts with iOS support, I assume?...) is a production-ready solution for developing mobile applications. |
@johanvos did some recent work in the area of supporting JavaFX via native images. |
@cstancu any news on the issue ???? more than ONE YEAR ???? you are looking since May 4, 2018 ??? so what now ???. |
https://gluonhq.com/a-boost-for-java-on-the-client/ |
@chengenzhao , thanks for the link BUT still only MAC NO windows yet. |
any update? 1.1 year passed |
This is currently working on Mac, Linux and iOS. See https://github.com/gluonhq/client-samples (docs for Linux are not there yet). |
Thanks for update! Sounds great
вс, 23 Июн 2019, 22:25 Johan Vos <[email protected]>:
… This is currently working on Mac, Linux and iOS. See
https://github.com/gluonhq/client-samples (docs for Linux are not there
yet).
We're working on Windows and Android now.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#403?email_source=notifications&email_token=AAGOWT26QRL4TY4WKNGOWZDP37L2JA5CNFSM4E6L2NG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYLGJ5I#issuecomment-504784117>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGOWT3VKWYHIB2NTYH2EHTP37L2JANCNFSM4E6L2NGQ>
.
|
Thank you, looking forward to it. |
Hey. I've just tried 19.1.0 with JavaFX app: https://github.com/4ntoine/NotesClientApp/ Getting the following exception:
jfxrt.jar contains command-line seems to be correct: https://www.graalvm.org/docs/reference-manual/aot-compilation/ I can imagine some class that javafx.application.Application references can't be found.. What am i missing? |
Does it require JavaFX 12 min? https://github.com/gluonhq/client-samples/blob/master/Gradle/HelloFX/build.gradle Currently i'm trying with JavaFX8. |
an issue stayed so long time ;) |
Any work around other than gloun. Because so many libraries cannot work with it. |
I have the same issue recently when I want to make a JavaFx app executable. After go through the code, I found it had more debugging info when add Here are the steps when I tried to fix the native-image problems.
D:\code\java\jfx-simple\shade>jfx -Dprism.verbose=true
Dec 03, 2021 9:52:42 AM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @37095ded'
Prism pipeline init order: d3d sw
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.d3d.D3DPipeline
Loading D3D native library ...
GraphicsPipeline.createPipeline failed for com.sun.prism.d3d.D3DPipeline
java.lang.UnsatisfiedLinkError: no prism_d3d in java.library.path
at com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibraryRelative(NativeLibrarySupport.java:132)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:133)
at java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.lang.System.loadLibrary(System.java:1871)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:166)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:54)
at com.sun.prism.d3d.D3DPipeline.lambda$static$0(D3DPipeline.java:54)
at java.security.AccessController.doPrivileged(AccessController.java:87)
at com.sun.prism.d3d.D3DPipeline.<clinit>(D3DPipeline.java:50)
at java.lang.Class.ensureInitialized(DynamicHub.java:552)
at java.lang.Class.forName(DynamicHub.java:1436)
at java.lang.Class.forName(DynamicHub.java:1408)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
GraphicsPipeline.createPipeline failed for com.sun.prism.sw.SWPipeline
java.lang.ClassNotFoundException: com.sun.prism.sw.SWPipeline
at java.lang.Class.forName(DynamicHub.java:1433)
at java.lang.Class.forName(DynamicHub.java:1408)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
Graphics Device initialization failed for : d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:254)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:264)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
... 3 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:276)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
D:\code\java\jfx-simple\shade>
D:\code\java\jfx-simple\shade>jfx -Dprism.verbose=true
Dec 03, 2021 9:53:38 AM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @37095ded'
Prism pipeline init order: d3d sw
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.d3d.D3DPipeline
Loading D3D native library ...
succeeded.
GraphicsPipeline.createPipeline failed for com.sun.prism.d3d.D3DPipeline
java.lang.NoSuchFieldError: com.sun.prism.impl.PrismSettings.forceGPU
at com.oracle.svm.jni.functions.JNIFunctions$Support.getFieldID(JNIFunctions.java:1126)
at com.oracle.svm.jni.functions.JNIFunctions.GetStaticFieldID(JNIFunctions.java:434)
at com.sun.prism.d3d.D3DPipeline.nInit(D3DPipeline.java)
at com.sun.prism.d3d.D3DPipeline.lambda$static$0(D3DPipeline.java:58)
at java.security.AccessController.doPrivileged(AccessController.java:87)
at com.sun.prism.d3d.D3DPipeline.<clinit>(D3DPipeline.java:50)
at java.lang.Class.ensureInitialized(DynamicHub.java:552)
at java.lang.Class.forName(DynamicHub.java:1436)
at java.lang.Class.forName(DynamicHub.java:1408)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
GraphicsPipeline.createPipeline failed for com.sun.prism.sw.SWPipeline
java.lang.ClassNotFoundException: com.sun.prism.sw.SWPipeline
at java.lang.Class.forName(DynamicHub.java:1433)
at java.lang.Class.forName(DynamicHub.java:1408)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:92)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
Graphics Device initialization failed for : d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
eline found
at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:254)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:264)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:679)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
at java.lang.Thread.run(Thread.java:829) at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
D:\code\java\jfx-simple\shade>
D:\code\java\jfx-simple\shade>jfx -Dprism.verbose=true
Dec 03, 2021 10:12:55 AM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @460b6d54'
Prism pipeline init order: d3d sw
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.d3d.D3DPipeline
Loading D3D native library ...
succeeded.
D3DPipelineManager: Created D3D9Ex device
Direct3D initialization succeeded
(X) Got class = class com.sun.prism.d3d.D3DPipeline
Initialized prism pipeline: com.sun.prism.d3d.D3DPipeline
Maximum supported texture size: 8192
Maximum texture size clamped to 4096
OS Information:
Windows version 0.0 build 0
D3D Driver Information:
null
null
Driver null, version 0.0.0.0
Pixel Shader version 0.0
Device : ven_0000, dev_0000, subsys_00000000
Max Multisamples supported: 0
vsync: true vpipe: true
Dec 03, 2021 10:12:55 AM com.sun.javafx.css.StyleManager loadStylesheetUnPrivileged
WARNING: Resource "com/sun/javafx/scene/control/skin/modena/modena.css" not found.
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Method.java:566)
at com.sun.prism.d3d.D3DResourceFactory.createStockShader(D3DResourceFactory.java:429)
at com.sun.prism.impl.ps.BaseShaderContext.getPaintShader(BaseShaderContext.java:269)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:500)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:430)
at com.sun.prism.impl.ps.BaseShaderGraphics.drawString(BaseShaderGraphics.java:2090)
at com.sun.javafx.sg.prism.NGText.renderText(NGText.java:312)
at com.sun.javafx.sg.prism.NGText.renderContent2D(NGText.java:270)
at com.sun.javafx.sg.prism.NGShape.renderContent(NGShape.java:261)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:579)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:579)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:480)
at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:329)
at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:92)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:126)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
Caused by: java.lang.RuntimeException: InputStream must be non-null
at com.sun.prism.d3d.D3DResourceFactory.getBuffer(D3DResourceFactory.java:365)
at com.sun.prism.d3d.D3DResourceFactory.createShader(D3DResourceFactory.java:409)
at com.sun.prism.shader.Texture_Color_Loader.loadShader(Texture_Color_Loader.java:49)
... 31 more
java.lang.InternalError: Error loading stock shader Texture_Color
at com.sun.prism.d3d.D3DResourceFactory.createStockShader(D3DResourceFactory.java:432)
at com.sun.prism.impl.ps.BaseShaderContext.getPaintShader(BaseShaderContext.java:269)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:500)
at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:430)
at com.sun.prism.impl.ps.BaseShaderGraphics.drawString(BaseShaderGraphics.java:2090)
at com.sun.javafx.sg.prism.NGText.renderText(NGText.java:312)
at com.sun.javafx.sg.prism.NGText.renderContent2D(NGText.java:270)
at com.sun.javafx.sg.prism.NGShape.renderContent(NGShape.java:261)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:579)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:579)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:480)
at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:329)
at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:92)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:126)
at java.lang.Thread.run(Thread.java:829)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
at com.oracle.svm.core.windows.WindowsJavaThreads.osThreadStartRoutine(WindowsJavaThreads.java:138)
QuantumRenderer: shutdown
vsync: true vpipe: true
QuantumRenderer: shutdown
D:\code\java\jfx-simple\shade> Then the last workable configuration is |
"simplest" Solution is GluonFX ... it handles resources, FXML, css and so on. I am using the latest 2022.1-dev and am quite happy with it, running quite complex FXML based FX Apps, but it was a lot of pain to find out all the configuration stuff. Some hints here ...
1.) test your application, if it runs fine with mvn gluonfx:run go to step 2 :) 2.) native-image-agent must be used to create config files for resources (FXML and css for example), reflection and so on:
3.) mvn gluonfx:build creates your native image. Since gluonfx:package is not supported Windows yet, use InnoSetup to create an installer 4.) the evil part is finding out which dll's are needed in the directory where your start your .exe since package does not do this (yet). Maybe not all of them needed, depending on your Application. awt.dll 5.) test your native image with mvn gluonfx:nativerun to get console output/errors
|
Use |
For those of you who are facing this problem, I managed to have an application working with JavaFX 17 (OpenJFX) and without the Gluon framework and custom JDK, simply using the official GraalVM build tools. The trick: graalvmNative {
binaries.all {
resources {
autodetection {
enabled.set(true)
restrictToProjectDependencies.set(false)
}
}
}
} The project I tried if you are interested: https://github.com/melix/astro4j |
Any news on this? I don't want to rely on Gluon either |
@palexdev Your linker command line is missing FX libraries completely -- are there any in the |
I couldn't find any info on how to add the .so libraries |
I thought you were using NIK based on the file paths in your log. Anyway, linker flags can be added using |
I am. I'm not using their 'full' variant because of the reason above Thanks, can these options be put in a json file too? |
@petermz Pastebin |
also trying to create a javafx native-image with gradle. unfortunately, the mentioned configuration from @melix example seem not to work/compatible with my stack because i still get that "No toolkit found". I use the gluon jvm
gradle/intellij also marks the block with: |
Ah yes, so, my app is finally out, I wanted to make an article on GraalVM but I'm too busy so, I'm going to post my findings and thoughts here, at least for now Long story short: GraalVM is a huge scam Detailed explanation:
From now on I'm not gonna consider GraalVM an option for deployment anymore. Good on paper, crappy execution in reality. As for your issue @damnms, I believe you can solve it by switching to SW rendering, check here to see how to set it up: ENBManager |
thanks for sharing your experience, i also encounter tons of problems. logging, jaxb stuff, javafx, ... guess i will also switch to jlink/jpackage. |
@palexdev Let me address some of your comments:
In general, if you are running into issues for your use case, it would be appreciated if you provide the relevant inputs to improve the open source project such that we can fix potential issues. This would be certainly more constructive than attacking the maintainers. Remember that GraalVM is a very large project and even if it does not fit your specific use case, others might find it very useful for what they are doing themselves. |
I'm quite certain that this is actually an issue with Gradle, or more precisely the Gradle javafx plugin. Generating configs with the tracing agent and then compiling a JavaFX application to native works flawlessly with Maven and even sbt(Scala) but not with Gradle. I'm getting the very same error. Posted an issue here. |
I wrote a project that worked through JavaFX's media module, Native Image, and was working with the media module. If you are interested, you can come to my Repository: |
@natsufumij your project uses maven, not gradle, and therefore has nothing to do with the problem reported by utilfunction |
Is JavaFX now supported by Graalvm? I tried out some ways to build static JavaFX app binary in this repo but still failed with the exact same error. Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline found If anyone of you have found a solution to this error without using gluonfx (because it does not build static executable), please let me know. |
Please reply if anyone knows how to fix this error. |
I think it may because you do not have the correct dependencies available on your OS. Try installing the dependencies listed here to see if that is the case: https://github.com/gluonhq/substrate |
Another possibility is that something is missing from your reflection config. QuantumToolkit is sure to rely on reflection heavily
|
@jskov I already have those dependencies installed in my Ubuntu machine, still, the native-image fails to start the JavaFX Application showing the below error message 👇 Graphics Device initialization failed for : sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics@22-ea/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
at javafx.graphics@22-ea/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)
at javafx.graphics@22-ea/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:263)
at javafx.graphics@22-ea/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:290)
at javafx.graphics@22-ea/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:651)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:671)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
at java.[email protected]/java.lang.Thread.runWith(Thread.java:1583)
at java.[email protected]/java.lang.Thread.run(Thread.java:1570)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:853)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:829)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics@22-ea/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
at javafx.graphics@22-ea/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
... 4 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
at javafx.graphics@22-ea/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:275)
at javafx.graphics@22-ea/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:290)
at javafx.graphics@22-ea/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:162)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:651)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:671)
at javafx.graphics@22-ea/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
at java.[email protected]/java.lang.Thread.runWith(Thread.java:1583)
at java.[email protected]/java.lang.Thread.run(Thread.java:1570)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:853)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:829) |
@petermz I already had that present in my |
Any other ideas? 🤔 |
I bashed my head against this error (and others) for a few weeks with my JavaFX application.
I export those files into the same path as the exe. If you're still receiving errors after that, ensure you have your reflection properly configured. Launch the application with gluonfx:runagent (within x64 Native Tools Command Prompt from Visual Studio) and access everything to map out a full reflection. Now build, your app should run just fine. |
@Lemon-King Sorry for the late reply 😞. I was busy last week. I am using Ubuntu so, I placed my executable in the same folder where .so files were placed. But, the app still failed with the same error. Moreover, I wasn't using Gluonfx maven plugin because it does not build static executables which I needed. So, I preferred to use only GraalVM but got stuck in that error. |
I'm trying to use GraalVM EE and GraalVM CE with OpenJFX installed to generate a native image for ClassViewer, but they could not operate properly for different reasons
GraalVM CE with OpenJDK:
GraalVM EE:
The text was updated successfully, but these errors were encountered: