B4J Tutorial Run B4J java and javafx Applications on ARM64 Computers

To run a B4J console or GUI Application on any 64-bit ARM computer, follow these steps:

Have tested it on Raspberry Pi 4 and Orange Pi Zero 3, running Ubuntu 21.04 and 22.04 respectively:

STEP 1: Install openjfx11

sudo apt-get update
sudo apt-get install openjfx

STEP 2: Find out where openJfx is installed

dpkg-query -L openjfx

NOTE: ..... should be installed in /usr/share/openjfx

STEP 3: Install OpenJDK11 and check version

sudo apt install default-jre

sudo java -version

STEP 4: Run Program

sudo java -jar --module-path /usr/share/openjfx/lib --add-modules javafx.controls yourB4Jprogram.jar

NOTE: You can run B4J jar files compiled with Oracle Java 8 as well as OpenJDK11


Instead of typing the long command line, you can create a shell script with the above command line and pass your jar file as a parameter:

1. Create a file called "jrun" with the following two lines:

#!/bin/bash
sudo java -jar --module-path /usr/share/openjfx/lib --add-modules javafx.controls $1


2. Make the file executable:

chmod +x jrun

3. Run the program with a simplified command line:

./jrun yourB4Jprogram.jar


Enjoy! :)




----------------------------------------------------------------------------
 
Top