D David Riley Member Licensed User Longtime User Aug 10, 2014 #1 The face bounces around. But when I click on Files nothing happens. On the pc it lets me pick a destination and saves the image. Trying to run "Canvas1.Snapshot.WriteToStream(Out)" gives long error report starting: "java.lang.RuntimeException: java.lang.NoClassDefFoundError: javafx/embed/swing/SwingFXUtils at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:82)" Should I have included SwingFXUtils somewhere ?
The face bounces around. But when I click on Files nothing happens. On the pc it lets me pick a destination and saves the image. Trying to run "Canvas1.Snapshot.WriteToStream(Out)" gives long error report starting: "java.lang.RuntimeException: java.lang.NoClassDefFoundError: javafx/embed/swing/SwingFXUtils at anywheresoftware.b4a.BA.raiseEvent2(BA.java:114) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:82)" Should I have included SwingFXUtils somewhere ?
Erel B4X founder Staff member Licensed User Longtime User Aug 10, 2014 #2 The ARM Java runtime doesn't include this class so you cannot call Image.WriteToStream in Raspberry PI. Upvote 0
The ARM Java runtime doesn't include this class so you cannot call Image.WriteToStream in Raspberry PI.
D David Riley Member Licensed User Longtime User Aug 10, 2014 #3 That's a blow. Is there any way round it ? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Aug 10, 2014 #4 Which version of Java have you installed on the pi? Try to install the latest Java 8. Upvote 0
D David Riley Member Licensed User Longtime User Aug 10, 2014 #5 jdk1.8.0_06 jdk-8u6-linux-arm-vfp-hflt.tar.gz Upvote 0
rwblinn Well-Known Member Licensed User Longtime User Aug 10, 2014 #6 Hi, For Raspberry Pi at present Media and Web modules are NOT included (=supported). This is a recent statement from the Oracle Java Development Team related to the Java 8 ARM version: ... we have not removed anything from JDK 8 that would cause it to be labeled a "lite" version. There are some components that are not part of the Java SE 8 specification but rather optional add-ons, such as JavaDB and (yes) JavaFX. Until a component is part of the spec - which is a longer process - changes to it are to be expected. For JavaFX specifically, this is still very much under development. We started on desktops (Windows/Mac/Linux, x86) and are adding support for Linux/ARM now. The Linux/ARM work we do is primarily intended for smaller embedded devices, not fully functional desktops, and our development priorities are set accordingly - media/web not done at this point for instance. However, not that JavaFX is completely open source through the OpenJFX project so if you have the interested, skill and time on your hands you can fill this gap yourself! ... BTW: Have tested also recently a B4J UI app on a Raspberry Pi - See here, select Category Raspi Item Build a B4J UI App with some hints. Upvote 0
Hi, For Raspberry Pi at present Media and Web modules are NOT included (=supported). This is a recent statement from the Oracle Java Development Team related to the Java 8 ARM version: ... we have not removed anything from JDK 8 that would cause it to be labeled a "lite" version. There are some components that are not part of the Java SE 8 specification but rather optional add-ons, such as JavaDB and (yes) JavaFX. Until a component is part of the spec - which is a longer process - changes to it are to be expected. For JavaFX specifically, this is still very much under development. We started on desktops (Windows/Mac/Linux, x86) and are adding support for Linux/ARM now. The Linux/ARM work we do is primarily intended for smaller embedded devices, not fully functional desktops, and our development priorities are set accordingly - media/web not done at this point for instance. However, not that JavaFX is completely open source through the OpenJFX project so if you have the interested, skill and time on your hands you can fill this gap yourself! ... BTW: Have tested also recently a B4J UI app on a Raspberry Pi - See here, select Category Raspi Item Build a B4J UI App with some hints.
D David Riley Member Licensed User Longtime User Aug 10, 2014 #7 Hi Rob, I'm completely new to Java and Linux. So I don't have much skill to do things myself. My best source of information has been your website. Thanks very much. I've been able to get UI apps to work. But the saving of graphics to file failed when run on Raspberry Pi. Is there possibly an optional add-on to do this ? David Upvote 0
Hi Rob, I'm completely new to Java and Linux. So I don't have much skill to do things myself. My best source of information has been your website. Thanks very much. I've been able to get UI apps to work. But the saving of graphics to file failed when run on Raspberry Pi. Is there possibly an optional add-on to do this ? David
rwblinn Well-Known Member Licensed User Longtime User Aug 11, 2014 #8 Hi David, have not tried - will look into next week. Thanks for the feedback regarding my website. Upvote 0
rwblinn Well-Known Member Licensed User Longtime User Mar 28, 2018 #9 (Reply Post #7) A rather late answer, but thought I share a solution as building a JavaFX Dashboard running on a Raspberry Pi 3 Model B+ (RPi). The dashboard is part of a Home Automation solution in progress. Started developing the dashboard step-by-step and one feature is to make a screenshot of the dashboard when running on the RPi. Create Screenshot Example creating a screenshot of the main form when the application runs in full screen on a Raspberry Pi. Tested on a RPi 3 Model B+ running Stretch, jdk1.8.0_162, Gluon JavaFXPorts armv6hf-sdk-8.60.9. Requirements B4X: Expand Collapse Copy #Region Project Attributes #MainFormWidth: 600 #MainFormHeight: 600 'The jar jfxrt is required for the class SwingFXUtils to make a screenshot of the mainform when running on the RPi. 'This to avoid runtime error: java.lang.NoClassDefFoundError: javafx/embed/swing/SwingFXUtils 'Copy c:\Program Files (x86)\Java\jdk8\jre\lib\ext\jfxrt.jar to the B4J additional libraries folder. 'Note: Check your JDK path prior copying to the B4J additional library folder. #AdditionalJar: jfxrt #MergeLibraries: True #End Region Example sub make a snapshot of the mainform B4X: Expand Collapse Copy Sub FormSnapShot Dim img As Image = MainForm.RootPane.Snapshot Dim Out As OutputStream = File.OpenOutput(File.DirApp, "rpicputemperaturedashboard.png", False) img.WriteToStream(Out) Out.Close End Sub Notes When running via the B4J-Bridge, the screenshot is stored in the tempjars folder. Example Dashboard Raspberry Pi CPU Temperature (measured every 5 seconds) The B4J source attached - the CPU Temperature is measured using resumable sub, the gauge properties are set using API method via a JavaObject. Attachments rpicputemperaturedashboard.zip rpicputemperaturedashboard.zip 4.5 KB · Views: 379 Upvote 0
(Reply Post #7) A rather late answer, but thought I share a solution as building a JavaFX Dashboard running on a Raspberry Pi 3 Model B+ (RPi). The dashboard is part of a Home Automation solution in progress. Started developing the dashboard step-by-step and one feature is to make a screenshot of the dashboard when running on the RPi. Create Screenshot Example creating a screenshot of the main form when the application runs in full screen on a Raspberry Pi. Tested on a RPi 3 Model B+ running Stretch, jdk1.8.0_162, Gluon JavaFXPorts armv6hf-sdk-8.60.9. Requirements B4X: Expand Collapse Copy #Region Project Attributes #MainFormWidth: 600 #MainFormHeight: 600 'The jar jfxrt is required for the class SwingFXUtils to make a screenshot of the mainform when running on the RPi. 'This to avoid runtime error: java.lang.NoClassDefFoundError: javafx/embed/swing/SwingFXUtils 'Copy c:\Program Files (x86)\Java\jdk8\jre\lib\ext\jfxrt.jar to the B4J additional libraries folder. 'Note: Check your JDK path prior copying to the B4J additional library folder. #AdditionalJar: jfxrt #MergeLibraries: True #End Region Example sub make a snapshot of the mainform B4X: Expand Collapse Copy Sub FormSnapShot Dim img As Image = MainForm.RootPane.Snapshot Dim Out As OutputStream = File.OpenOutput(File.DirApp, "rpicputemperaturedashboard.png", False) img.WriteToStream(Out) Out.Close End Sub Notes When running via the B4J-Bridge, the screenshot is stored in the tempjars folder. Example Dashboard Raspberry Pi CPU Temperature (measured every 5 seconds) The B4J source attached - the CPU Temperature is measured using resumable sub, the gauge properties are set using API method via a JavaObject.