B4J Question Run UI App in Linux - Ubuntu 18.04.2

JCO

Active Member
Licensed User
Longtime User
Hello,

I have a pretty simple UI B4J App which basically calls a Web Page, receives a response and shows it on a form.
It works perfectly in Windows, but I can't get it to run on Ubuntu.
I get this error:
Error: JavaFX runtime components are missing, and are required to run this application
It was createded on B4J 7.31 with JDK 11.0.1
On the Linux box, both jdk and jfx 11 are installed:
openjdk-11-jdk is already the newest version (11.0.2+9-3ubuntu1~18.04.3).
openjfx is already the newest version (11.0.2+1-1~18.04.2).
I have looked thru all the questions and tutorials and still can't get it to run. Would anybody have any ideas?
 

JCO

Active Member
Licensed User
Longtime User
B4JPackager 11
Thanks jahswani,

I already tried, and this is what I get:
gsit@GSIT:~/Documents/global$ java -jar B4JPackager11.jar gspdp.json
B4JPackager11 Version 1.02
InputJar: gspdp.jar
Folder not found: /usr/lib/jvm/java-11-openjdk-amd64/bin/../javafx/javafx-jmods
 
Upvote 0

JCO

Active Member
Licensed User
Longtime User
That's what I did in my Windows machine, where B4J is. It works like a charm.
Now, on the Linux box (I suppose you already noticed I'm fairly new to Linux), what I did is install the Java components how I understand is the regular way:
B4X:
sudo apt install openjdk-11-jdk

and

sudo apt install openjdk-11-jdk openjfx

They installed OK.
Now, if I understand you correctly, I should then uninstall those and then expand Erel's package. Where on the disk should I do that? (It doesn't let me do it on the usr/lib/jvm folder :( )
 
Upvote 0

jahswant

Well-Known Member
Licensed User
Longtime User
They installed OK.
Now, if I understand you correctly, I should then uninstall those and then expand Erel's package. Where on the disk should I do that? (It doesn't let me do it on the usr/lib/jvm folder :( )
Use any folder.
Command line with a json file

You can create a json file with the input jar and optionally other settings and run it from the command line:
B4X:
<java 11>\bin\java -jar B4JPackager11.jar <json file>
The json file should look like this:
B4X:
{
   InputJar: "C:/Users/H/Documents/B4X/X2/Angry Birds/B4J/Objects/AngryBirds.jar"
}
Use forward slashes as I did above.

If you want to remove javafx.web from the excluded modules:
B4X:
{
   InputJar: "C:/Users/H/Documents/B4X/X2/Angry Birds/B4J/Objects/AngryBirds.jar",
   ExcludedModules: []
}
 
  • Like
Reactions: JCO
Upvote 0

JCO

Active Member
Licensed User
Longtime User
Use any folder.
Many thanks! I didn't notice the path part in the command line that lets you use a java in any folder
It works! :)
Just a follow-up question if you don't mind:
It works on the machine in which it has now been created when I run the "run.command" file. My question is:
How do I now distribute it to other PCs? that is: What files do I have to copy and how will it be executed there?
 
Upvote 0

JCO

Active Member
Licensed User
Longtime User
You need to distribute the complete "build" folder.
Thanks Erel,

This is probably a stupid question but, I'm not sure how it goes afterwards.
I distribute the whole folder, the the users run the 'run.command' file and then, is there a jar that is built? or every time they want to run it (ideally it should be done on every boot of the machine) the same procedure needs to be executed?

thanks again,
 
Upvote 0
Top