B4J Question External JavaFX not found

peacemaker

Expert
Licensed User
Longtime User
Hi, All

I'm trying to use

B4X:
book:~/jdk$ java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)


book:~/jdk$ java -jar b4j-bridge.jar
B4J-Bridge v1.50
Running on Java 11+
External JavaFX not found. Searching for internal modules...
Waiting for connections (port=6790)...
My IP address is: 192.168.1.92
FTP Server started: ftp://192.168.1.92:6781
Start B4J-Bridge with -disableftp to disable.
JavaFX modules:
Connected!

But no JavaFX.
OpenJDK 11 + OpenJFX 11 got from the link for Linux - https://b4xfiles-4c17.kxcdn.com/b4j/linux_jdk-11.0.1.zip from tutorial page.

b4j-bridge.jar is placed into /jdk/bin. But if placed to /jdk root - the same, not found.
Any help ?
 

peacemaker

Expert
Licensed User
Longtime User
Opps. But i cannot find 11.0.1 to make
B4X:
sudo apt install openjdk-11.0.1-jdk

Archive with files was just downloaded and unpacked to home folder.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
I am using the openJDK 11 from the tutorial
How did you "install" it after download? What is "java -version" at you?
Where should OpenJFX files be?
 
Last edited:
Upvote 0

aeric

Expert
Licensed User
Longtime User
How did you "install" it after download? What is "java -version" at you?
If you are using the Ubuntu Desktop, just drag out the folder using Archiver.
Here is what I have in my Ubuntu 20.04.3 guess in Virtualbox.

~$ /home/aeric/jdk-11.0.1/bin/java -version

yields:

openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
It's after uninstalling the installed openjdk 11.0.11:

B4X:
vlad@vlad-easynote-book:~/jdk$ /home/vlad/jdk/bin/java -jar b4j-bridge.jar
Error: Unable to access jarfile b4j-bridge.jar
vlad@vlad-easynote-book:~/jdk$

File rights were given.:(
What is "installation" process of openjdk in Linux? And how to correct do it with just unpacked Java files pack of needed version?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
I had to "apt install" Openjdk, to fix the possibility to work (again 11.0.11 was installed).
Now the Bridge is OK, but only if to start it by "our Java 11.0.1" in unpacked folder.
App is beginning to run under Linux from Win10 B4J PC :) (and i still do not know how to start my app Release on Linux manually).

Thank you, @aeric, for help !

Now solving error of the dll lib:
B4X:
Caused by: java.lang.UnsatisfiedLinkError: no b4jcv_344_01 in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
do not know how to start my app Release on Linux manually
What do you mean? Do you want to run B4J UI or non-UI app?
Non-UI -> just copy the Release jar to a directory and call the jar using java -jar myapp.jar or using nohup command and output a log
UI -> You need to copy the Release jar and create a new/modify the packager.json file with path to the jar file then use B4JPackager11 to re-compile the jar and create some dependencies files. Once done, execute the run.command script.
 
Upvote 0

rspitzer

Active Member
I had a similar problem, denoted by your first screen post. The issue is when the bridge is invoked, it needs to know where the JFX files reside. You need to set your PATH_TO_FX so the program will find the JFX files. When you turn on the terminal, it opens a bash script, it is called .bashrc, at the end of this file I placed both the JAVA_HOME and PATH_TO_FX - (Below are examples using paths on my system, yours will probably be different)

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64/bin
export PATH_TO_FX=/usr/lib/jvm/java-11-openjdk-arm64/javafx/lib
 
Upvote 0
Top