B4J Question B4J-Bridge macOS 26 (Tahoe)

RussellM72

Member
Licensed User
Hello,

I'm trying to use B4J-Bridge to test a program on my Mac.

I'm running macOS Tahoe (26.2).

I installed openJDK 25 using Homebrew (brew install openjdk)

When I run java --version, this is what I get:

russ@Russells-MacBook-Air Downloads % java --version
openjdk 25.0.1 2025-10-21
OpenJDK Runtime Environment Homebrew (build 25.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 25.0.1, mixed mode, sharing)

When I run the B4J-Bridge, this is what I get:

russ@Russells-MacBook-Air Downloads % java -jar b4j-bridge.jar
B4J-Bridge v1.61
Running on Java 11+
/opt/homebrew/Cellar/openjdk/25.0.1/libexec
External JavaFX not found. Searching for internal modules...
Waiting for connections (port=6790)...
My IP address is: 10.37.129.2
FTP Server started: ftp://10.37.129.2:6781
Start B4J-Bridge with -disableftp to disable.
JavaFX modules:

If I try and connect from the IDE using that IP address, I get a dialog that states:

Ping failed (IP = 10.37.129.2):
The IP address is most probably incorrect.
Do you want to use it?

If I answer "Yes", the status at the bottom of the IDE window is:

B4J-Bridge: Trying to connect...

If I use my Mac's IP address for the Wi-Fi from system settings (192.168.0.190), I get:

B4J-Bridge (Unknown): Connected

...and the Terminal session on my Mac shows "Connected!"

However, when I try to run the project (which is just the math quiz project from the B4X Getting Started pdf), the app doesn't appear on my Mac and this is what is show in the Terminal where B4J-Bridge is running:

russ@Russells-MacBook-Air Downloads % java -jar b4j-bridge.jar
B4J-Bridge v1.61
Running on Java 11+
/opt/homebrew/Cellar/openjdk/25.0.1/libexec
External JavaFX not found. Searching for internal modules...
Waiting for connections (port=6790)...
My IP address is: 10.37.129.2
FTP Server started: ftp://10.37.129.2:6781
Start B4J-Bridge with -disableftp to disable.
JavaFX modules:
Connected!
Starting program
ProcessCompleted

I'm wondering if this is related to that message:

External JavaFX not found. Searching for internal modules...

In fact, as I'm typing this out, I did an DuckDuckGo search for "homebrew javafx" and found the followiing:


I feel like that the focus of B4X these days is more towards mobile development for iPhones and Androids, however, I currently want to figure out how to make and package some desktop apps for macOS and Linux. To that end, I wish there existed a current, concise guide to the best practices for building, compiling, and packaging B4J apps for macOS and Linux. It seems like there's multiple forum posts that have to be read and interpreted before figuring out how deploy B4J apps on macOS and/or Linux.
 

RussellM72

Member
Licensed User
As is often my way, I've ended up figuring out some solutions after making my post.

One solution was to download an OpenJDK that includes JavaFX and install that:


I opted to install the .dmg version.

Then I was able to just run:

java -jar [path to b4j-bridge.jar]

I don't remember if that listed the correct IP address or not. I just scrolled back in my Terminal. It was not listing the correct IP address.

But, it worked. I could connect via the B4J IDE using the IP address of my Wi-Fi adapter (obtained from System Settings) and then click run and the app would then compile and appear on my Mac.

Solution two was to download the 3 files listed under the Java heading on this page.

I unzipped all of them in a folder I simply named "java" in my home directory. (The example on that page shows them unzipped in ~/Downloads.)

Then, I could start the B4J-Bridge by doing the following:

~/java/jdk-19.0.1.jdk/Contents/Home/bin/java -jar ~/Downloads/b4j-bridge.jar

And I would get output like this:

B4J-Bridge v1.61
Running on Java 11+
/Users/russ/java
JavaFX modules: javafx.fxml,javafx.swt,javafx.media,javafx.graphics,javafx.swing,javafx.web,javafx.controls,javafx.base
External JavaFX path: /Users/russ/java/javafx-sdk-17.0.17/lib
Waiting for connections (port=6790)...
My IP address is: 192.168.0.190
FTP Server started: ftp://192.168.0.190:6781
Start B4J-Bridge with -disableftp to disable.
Connected!

And, again, using the B4J IDE I was able to connect and then run my app on my Mac.

I don't know if I'm posting this reply to myself as a way of helping myself in the future when I forget what I learned today -or- in the hopes that it helps someone else.

I've gotten really rusty with Java and before trying to jump back into B4J development yesterday, I didn't even have it installed on my machine(s). I wish that B4J had documentation with best practices / recommended way of installing Java on Mac and Linux for the best compatibility with B4J especially relating to using B4J-Bridge and the B4JPackager11.
 
Upvote 0
Top