B4J Question Just starting with B4J for Raspberry pi. questions before I start

jimseng

Active Member
Licensed User
Longtime User
Hello. I have used B4A for a while and I thought I would start trying to do some apps for a Raspberry pi. Much of what I have searched for so far seems several years old so I thought I would ask if there is a recent tutorial on what I need on the Pi. For instance, which version of the jdk should I download? I haven't found a tutorial that refers to 64 bit jdk and i don't want to install the wrong version as I have a nice clean version of bookworm. Is there somewhere I should be looking for the latest info? What are the basics for running GUI apps on the latest Pi OS Bookworm?

My target Pi will be the Pi 5, but I am currently tsting with a Pi4. With the new GPIO hardware on the Pi 5 does anybody know how easy it is to access the GPIO pins on the Pi 5? Is it going to be painful?
 

Cableguy

Expert
Licensed User
Longtime User
Unless you get a hold of à jfx able Java version, UI apps are not straight forward in the raspberry pi.
You will neet to use something like the ABMATERIAL framework and run it like a local app, or as it was meant to be used, a webapp server.
 
Last edited:
Upvote 0

teddybear

Well-Known Member
Licensed User
1. Install jdk using apt or download it from Oracle.the minimum JDK requirement is 11 for jfx.
2. Download javafx from Gloun. the minimum version is 17 for aarch64.
3. It's easy to access the GPIO using Erel's jpi4j library.
4. As Cableguy said it seems a bit complex for using UI, but you can ask questions for the solution on the forum.
 
Upvote 0

jimseng

Active Member
Licensed User
Longtime User
OK thanks. So is there an up to date tutorial on this? For instance, from Gloun I have downloaded and unziped both the SDK and jmods. But where are they supposed to be/how do I reference them in relation to b4j-bridge.jar? (So far I get "External JavaFX not found") and I have searched but the answers I have found so far are 6 years old so having never done anything with Java it is a bit overwhelming, but I am quite a determined fellow. Just wondering if these steps are explained in detail and I have missed them.
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Try copying sdk and jmods to your javapath, it looks like this.
BTW, you'd better start a new thread for your new question
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
I will recommend to install Liberica JDK full version by Bellsoft which included the jFX.
 
Upvote 0

virpalacios

Active Member
Licensed User
Longtime User
Hi, I am using Liberica JDK, using it you can run B4J with GUI interfase, even I used remote debugger on my RPi4. Just be carefull configuring PATHs in order for your program to see the graphics modules.

Best Regards
 
Upvote 0

jimseng

Active Member
Licensed User
Longtime User
Thanks for the replies. I have got it working. Just for information purposes (And so I can refer back when I forget next time):
I downloaded :

From https://gluonhq.com/products/javafx/ I downloaded aarch64 SDK and jmods:


exctracted openjdk-22.0.2 and then extracted Gluon openjfx SDK and jmods

I renamed (mv) javafx-sdk-22.0.2 to "javafx" and placed it in the jdk-22.0.2 folder
Renamed javafx-jmods-22.0.2 to "javafx-jmods" and moved it to the newly renamed javafx folder (which is in the jdk-22.0.2)

For me this makes the paths simple as they are relative to jdk-22.0.2/bin/java

I only have a very simple test gui program so far with 1 button but at least it works, and using RDP which is a bonus.
 
Upvote 0
Top