B4J Question WriteToStream Problem on RPi

peter01

Member
Licensed User
Longtime User
Hello,
I have a program in which I save a B4J image to a stream with:
B4X:
        Dim out As OutputStream = File.OpenOutput("", res_name, False)
        ibmp_pr.WriteToStream(out)
        out.Close
This works on PC and Mac (Java 8) but with RPi (Java 11.01) there is an error shown as:

B4X:
main._btn_save_click (java line: 537)
java.lang.NoClassDefFoundError: javafx/embed/swing/SwingFXUtils
    at anywheresoftware.b4j.objects.ImageViewWrapper$ImageWrapper.WriteToStream(ImageViewWrapper.java:182)
    at b4j.example.main._btn_save_click(main.java:537)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.BA$1.run(BA.java:216)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: javafx.embed.swing.SwingFXUtils
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)

It seems that this method is not implemented in Java 11.01 for Arm.....?

Does anybody know a workaround for this problem ?
 
Top