ltorok
Posts: 13
Joined: Wed Aug 06, 2014 4:27 am

JavaFX application not working on Raspbian Stretch/Raspberry Pi Zero W 1.1

Tue Oct 10, 2017 8:04 am

I am using JavaFX Embedded SDK 8.60.9 (armv6 hard float platform) by Gluon - http://gluonhq.com/products/mobile/javafxports/get/
I am launching simple JavaFX application type of Hello World from NetBeans 8.2 (Remote Platform)/Windows 10 on my Raspberry Pi Zero W 1.1/latest Raspbian Stretch and I am getting this problem:

In Output window in NetBeans 8.2 is this output (only extract):
Loaded /home/pi/armv6hf-sdk/rt/lib/ext/../arm/libglass_monocle.so from relative path
java.lang.UnsatisfiedLinkError: Error loading libGLESv2.so
at com.sun.glass.ui.monocle.AcceleratedScreen.initPlatformLibraries(AcceleratedScreen.java:158)
at com.sun.glass.ui.monocle.AcceleratedScreen.<init>(AcceleratedScreen.java:68)
at com.sun.glass.ui.monocle.DispmanAcceleratedScreen.<init>(DispmanAcceleratedScreen.java:34)
at com.sun.glass.ui.monocle.DispmanPlatform.getAcceleratedScreen(DispmanPlatform.java:43)
at com.sun.prism.es2.MonocleGLFactory.initialize(MonocleGLFactory.java:107)
at com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:82)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:187)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
at java.lang.Thread.run(Thread.java:748)
(X) Got class = class com.sun.prism.es2.ES2Pipeline
GraphicsPipeline.createPipeline: error initializing pipeline com.sun.prism.es2.ES2Pipeline
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
Loaded /home/pi/armv6hf-sdk/rt/lib/ext/../arm/libprism_sw.so from relative path
(X) Got class = class com.sun.prism.sw.SWPipeline
Initialized prism pipeline: com.sun.prism.sw.SWPipeline
JavaFX: using com.sun.javafx.tk.quantum.QuantumToolkit
Cannot open display
vsync: true vpipe: false

ES2 pipeline (hw accelerated) is not used, used is SW pipeline - graphics is rendered but missing visibled mouse cursor.
More about this problem, see:
https://bitbucket.org/javafxports/8u-de ... eline-dont
https://stackoverflow.com/questions/466 ... zero-w-1-1

Please any help. Thanks.

ghans
Posts: 7784
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: JavaFX application not working on Raspbian Stretch/Raspberry Pi Zero W 1.1

Tue Oct 10, 2017 8:31 am

I think JavaFX and Java3D simply do not work on the ARMv6-based Pis. This is a decision made by Oracle. If you want reasonably fast 3D with Java on ARMv6-based Pis you must use something else like JOGL.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
xranby
Posts: 538
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: JavaFX application not working on Raspbian Stretch/Raspberry Pi Zero W 1.1

Wed Oct 11, 2017 11:31 am

The Raspbian system ships with two libGLESv2 implementations, Broadcom and Mesa 3D.

The August 2017 Raspbian release moved Broadcom's GLESv2 and EGL library to a custom prefix name (libbrcm*) in order to expose the two different implementations under two different names. This namechange fixed a lot of issues in other software that tries to load the EGL implementations dynamically and only expect that the system have one implementation, the system dynamic liker was prone to crash if it picked up EGL from implementation A and GLESv2 from implementation B because the two implementations where never designed to be compatible. I think the name change is a really good move because Broadcom's EGL and GLESv2 required custom initialization thus no Khronos standard compliant OpenGL ES application could use Broadcom's implementation without adding some custom modifications. The Mesa 3D implementation follows the Khronos standard and hence it is good to have it under the standard name.

OpenJFX shipped by Gluon is hardwired to look for the libGLESv2.so using the old name at broadcoms /opt/vc/lib location.

The proper way to fix it is to update OpenJFX with help by Gluon so that it loads the right implementation using the new name when using the latest Raspbian release.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

ltorok
Posts: 13
Joined: Wed Aug 06, 2014 4:27 am

Re: JavaFX application not working on Raspbian Stretch/Raspberry Pi Zero W 1.1

Wed Oct 11, 2017 2:20 pm

Thanks xranby.
Your answer is right.

Here is source code for description of this problem (javafxports project for build JavaFX Embedded SDK also by Gluon): https://bitbucket.org/javafxports/8u-de ... ew-default

File (source file in Java - see link above): AcceleratedScreen.java
Line: 155
On this line is hardwired libGLESv2.so.
Correct: libbrcmGLESv2.so
Line: 160
- here is unvaliable in runtime because on line 158 is throws UnsatisfiedLinkError with the specified detail message "Error loading libGLESv2.so"
On this line is hardwired libEGL.so.
Correct: libbrcmEGL.so

I just have to building OpenJFX for ARM Hard Float and is it. This will be a problem.
Or I have to wait for the fix from Gluon? This can take a long time...

pbo
Posts: 2
Joined: Sat Mar 03, 2018 8:40 am

Re: JavaFX application not working on Raspbian Stretch/Raspberry Pi Zero W 1.1

Sat Mar 03, 2018 8:46 am

I checked how to cross compile with the fix, but I'm afraid that's a bit too much for my skills... Does anyone could share a build for OpenJFX with the fix proposed above?

Thank you!

User avatar
chriswhocodes
Posts: 37
Joined: Mon May 21, 2012 11:26 am
Location: London, UK
Contact: Website

Re: JavaFX application not working on Raspbian Stretch/Raspberry Pi Zero W 1.1

Tue Jul 10, 2018 10:09 pm

Thanks for this information xranby, ltorok.

I've made this fix in my OpenJFX build server for ARM: https://chriswhocodes.com/

https://chriswhocodes.com/downloads/ope ... cm-fix.zip

Cheers,

Chris
@chriswhocodes
http://www.chrisnewland.com/raspberrypi

Return to “Java”

Who is online

Users browsing this forum: No registered users and 0 guests