How to disable or bypass Hardware Graphics Acceleration(Prism) in JavaFX
Look at this forum: https://forums.oracle.com/message/11018975
Add this to your java execution:
-Dprism.order=j2d
That should do the trick.
What do d3d, es2, j2d, null3d, and sw in the javafx prism package represent?
Those packages represent implementations of different graphics-pipelines
- d3d is short for Direct3D, part of DirectX
- es2 is for OpenGL ES2.0
- j2d represents the Java 2D API
- null3d - not sure but probably a dummy-implementation for development/testing
- sw - software pipeline
JavaFX 0x300b: Could not get EGL surface
Finally I figured out...
Since I'm using buildroot all raspberry pi userland (GPU) libraries are in the /usr/lib
folder. However, going deep in the monocle source code, more precisely in the DispmanPlatformFactory.java, we can see the the way they match the platform is to search for the libbcm_host.so in /opt/vc/lib
which does not exist in the buildroot configuration. A quick workaround for those who use buildroot is to create a symbolic link to libbcm_host.so
in /opt/vc/lib
JavaFx badly displayed scene
It's an Environmental Issue
Likely JavaFX is incompatible with your video card and drivers.
Workaround
To workaround the rendering bug on your machine, explicitly disable the hardware rendering pipeline for JavaFX and only use the software rendering pipeline:
-Dprism.order=sw
using a java -D
property.
The behaviour you experienced seems buggy
The behavior looks like a bug. I think that, in the case of an unsupported graphics card, JavaFX is supposed to exit with an unsupported error or fall back to a software rendering pipeline rather than display garbled junk. You may wish to file a bug report at http://bugreport.java.com.
If you file a bug report so ensure that you include all information about the machine used for testing:
- Machine make and model.
- Video card or integrated graphics processor used.
- Exactly what version of the video drivers are installed.
- OS and Java version used.
You might also want to try updating your video card drivers and seeing if that fixes the issue.
Gate usage of conditional features using Platform.isSupported
Effects are conditional features, ensure you check if the the EFFECT
conditional feature is enabled for your system before you try to use an effect. Use Platform.isSupported:
if (Platform.isSupported(ConditionalFeature.EFFECT)) {
// use effects
}
If this fixes your issue, it is still an issue with the underlying JavaFX system as documentation states:
Using a conditional feature on a platform that does not support it will not cause an exception. In general, the conditional feature will just be ignored. See the documentation for each feature for more detail.
which is not occurring in your case.
Related Topics
Servlet Seems to Handle Multiple Concurrent Browser Requests Synchronously
Java - Reading, Manipulating and Writing Wav Files
Convert Epoch Seconds to Date and Time Format in Java
Using Scala Traits with Implemented Methods in Java
Java Interfaces Methodology: Should Every Class Implement an Interface
How to Make a Jbutton in a Jtable Cell Click-Able
Getting the Inputstream from a Classpath Resource (Xml File)
Raising a Number to a Power in Java
Javafx Using Objects from Maincontroller or Other Controllers in Proper Controller Class
Nullpointerexception Through Auto-Boxing-Behavior of Java Ternary Operator
How to Make a Deep Copy of Java Arraylist
How to Check If a String Contains Only Digits in Java
Org.Glassfish.Jersey.Servlet.Servletcontainer Classnotfoundexception
How to Get Backspace \B to Work in Eclipse's Console