B4J Question Jpeg images not displayed when running on Linux

CaptKronos

Active Member
Licensed User
Longtime User
I have been using B4J on Windows for quite a while but thought I would have a play with deploying my apps to Linux. Even quite complex apps were deployed seamlessly, with the only problem (so far) being jpeg images are not displayed. No errors are produced and the only thing I see in the log is:

B4X:
WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
WARNING: package com.sun.glass.ui.win not in javafx.graphics
WARNING: package com.sun.prism.d3d not in javafx.graphics
Waiting for debugger to connect...
Program started.
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.

I get the same results if I run in release or debug mode via B4j-Bridge, and the same when deployed locally via B4JPackager11.

This can be replicated by creating a new B4J project. Using the Designer to add an ImageView and set it to display a jpeg. Running this on Windows, you get what you would expect but on Linux just an empty window is displayed. Replacing the jpeg with a png or gif and it works. Googling I found a few non-B4X developers having a similar problem but their solution seemed to be to use a different JavaFx or JDK.

I am using an up to date B4J, OpenJDK11 on my Windows box and the recommended linux_jdk-14.0.1.zip on my Ubuntu 22.04 Linux box. Any advice would be much appreciated.
 

CaptKronos

Active Member
Licensed User
Longtime User
I have also tried with jpegs not in the assets folder and get the same result. But, as you suggest, I'll probably just use pngs instead. I'm just surprised that there aren't more people raising this issue.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
I have also tried with jpegs not in the assets folder and get the same result. But, as you suggest, I'll probably just use pngs instead. I'm just surprised that there aren't more people raising this issue.
I think not much users are using Linux. If they do, they probably develop for non-UI app or B4A apps.
If you have time to solve it, you may try to search on the Internet how to update the jpeg library or use different version of JDK in your Linux distro.
Otherwise, just don't use Jpeg image if possible.
 
Upvote 0
Top