B4J Question Ubuntu 22.04 JavaFX error

peacemaker

Expert
Licensed User
Longtime User
Hi, All

Bridge is started OK, it seems, with JavaFX modules, under Ubuntu 22.04:
lad@vtk1:~$ jdk-11.0.1/bin/java -jar b4j-bridge.jar
B4J-Bridge v1.50
Running on Java 11+
JavaFX modules: javafx.web,javafx.swing,javafx.controls,javafx.media,javafx.base,javafx.graphics,javafx.fxml,javafx.swt
External JavaFX path: /home/vlad/jdk-11.0.1/javafx/lib
Waiting for connections (port=6790)...
My IP address is: 192.168.1.100
FTP Server started: ftp://192.168.1.100:6781
Start B4J-Bridge with -disableftp to disable.
Connected!
Starting program
ProcessCompleted

But the app (B4XSerializator base example) is started with such error:
WARNING: package com.sun.glass.ui.win not in javafx.graphics
WARNING: package com.sun.prism.d3d not in javafx.graphics
~e:
~e:
(java:9669): Gdk-CRITICAL **: 19:07:29.496: gdk_x11_display_set_window_scale: assertion 'GDK_IS_X11_DISPLAY (display)' failed
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f0b8a8c7740, pid=9669, tid=9705
#
# JRE version: OpenJDK Runtime Environment (11.0.1+13) (build 11.0.1+13)
# Java VM: OpenJDK 64-Bit Server VM (11.0.1+13, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
#
C [libX11.so.6+0x2b740] XInternAtom+0x40
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/vlad/tempjars/core.9669)
#
# An error report file with more information is saved as:
# /home/vlad/tempjars/hs_err_pid9669.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Googled that it is:
Workaround (https://github.com/javafxports/openjdk-jfx/issues/175#issuecomment-417030981)
java -Djdk.gtk.version=2

This has been fixed in Openjfx12.

But how to fix during B4J debug ?
 
Last edited:

jahswant

Well-Known Member
Licensed User
Longtime User
Platforms

You must build the package on the target platform.
Windows - Java 11 should already be installed. Note that Java 11 is 64 bit only.

OpenJDK 11 + OpenJFX 11 (SDK + jmods) - GPL + classpath exception license
Mac - https://b4xfiles-4c17.kxcdn.com/b4j/mac_jdk-11.0.1.zip
Mac: Follow these instructions: MacSigner - Building notarized Mac packages
Linux - https://b4xfiles-4c17.kxcdn.com/b4j/linux_jdk-11.0.1.zip

OpenJDK 14 (same license):
Mac - https://b4xfiles-4c17.kxcdn.com/b4j/mac_jdk-14.0.1.zip
Linux - https://b4xfiles-4c17.kxcdn.com/b4j/linux_jdk-14.0.1.zip
Windows - https://b4xfiles-4c17.kxcdn.com/jdk-14.0.1.zip

Try with JDK14.

from this thread https://www.b4x.com/android/forum/t...the-simplest-way-to-distribute-ui-apps.99835/
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
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.
My IP = 192.168.1.100
Really helped, thanks !
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
It's logical, as no UI subsystem on the server, but !
But it's very important addition to my question. It seems, that the settings interface for non-UI app it's better to make based on HTML-forms... As UI app with interface can be used only from another desktop OS...
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Resume: it looks like the development under the newest Linux version - rather stupid idea.
For now it's better to re-install to Ubuntu 20.04. And maybe in a year the 22.04 will be usable :)
 
Upvote 0
Top