dankodomko
Posts: 4
Joined: Mon Dec 05, 2016 10:32 am

OpenJFX not working with OpenGL on RPi 3

Mon Dec 05, 2016 10:47 am

Hi, has anybody here I run into an error like this?
I created a small program in Java with JavaFX intended to use on a Raspberry Pi 3. However, only then I found out that Oracle does not provide JavaFX for ARM. Because I don't like the idea of rewriting the app, I've decided to test OpenJFX. The app is working - however, sometimes it does not render modal windows correctly (everything is suddenly upside down and so) - and in the console i found an error:

Code: Select all

error creating shader program
So, I tried to turn on the OpenGL experimental driver. After turning it on and rebooting the RPi, the only thing I saw was black screen. Nothing helped, I had to re-flash the sd card. On some forums I found out that all I have to do is to run:

Code: Select all

sudo BRANCH=next rpi-update
Did it, it worked. RPi now boots successfully with OpenGL (tested with glxgears).

Now what's the problem: after I try to run the app, all I get is this:

Code: Select all

Dispman: cannot open display
* failed to add service - already in use?
I tried to play with memory split - but nothing works (i tried 16, 64, 128, 192, 256... still the same.)

What would you suggest?
Thank you!


dankodomko
Posts: 4
Joined: Mon Dec 05, 2016 10:32 am

Re: OpenJFX not working with OpenGL on RPi 3

Mon Dec 05, 2016 2:00 pm

well, I don't think this adresses my problem.
I *am* able to run a JavaFX app - with the community build of OpenJFX from chriswhocodes.com
problems come after I turn on the OpenGL driver.

User avatar
topguy
Posts: 6997
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: OpenJFX not working with OpenGL on RPi 3

Mon Dec 05, 2016 2:20 pm

It was in response to your claim that JavaFx was not available for ARM. I seemed to remember some beta-release from Oracle.

But in general I assume that enabling OpenGL in X will lock some hardware that JavaFx needs (DispmanX it seems). I dont believe JavaFX has been made for ARM with the experimantal OpenGL driver in mind.
I think JOGL will work with the OpenGl driver, Processing 3 are using it I believe.

dankodomko
Posts: 4
Joined: Mon Dec 05, 2016 10:32 am

Re: OpenJFX not working with OpenGL on RPi 3

Mon Dec 05, 2016 3:29 pm

Yes, I was worried that this would be a no-go :)
Thank you!

Return to “Troubleshooting”