Making either a desktop short cut or startup application work immediately for a B4X application. Please note, this is a way I found, Linux and the various distros are rather flexible and I am no Linux Pro.
The main issue I had turned out to be making sure that the PATH_TO_FX was properly set as a permanent environment variable. I was running the B4X application from terminal, and I added the PATH_TO_FX statement to the end of the .bashrc file in the local home directory. So when I launched terminal, the PATH_TO_FX would be set, since opening terminal would first run the .bashrc file. Unfortunately this is not the case if you want to run a B4X application from the desktop, without first running terminal.
To change this and make the PATH_TO_FX permanent at login, you need to edit the text file:
/etc/profile and add at the end of the file, in my case "export PATH_TO_FX=/home/microcut/javafx-sdk-11.0.2/lib". Once I did this, I checked the PATH_TO_FX (after a reboot) in terminal using echo $PATH_TO_FX.
I wrote a small bash script called first.sh, using the nano editor.
#!/bin/sh
sudo java -jar --module-path $PATH_TO_FX --add-modules javafx.controls /home/microcut/serialtest.jar
(I actually don't need to use the sudo command, but left it in)
Also
Please note, that when I installed this linux distro (ubuntu mate 20-stripped version)., I just used the default java jdk and jre on it, which turns out to be java 11.0.2
sudo apt install default-jre
sudo apt install default-jdk
After I saved the bash script first.sh I then made the first.sh bash script executable using:
chmod +x first.sh
I then tested the bash script from terminal by just typing first.sh to test - worked fine (by the way I also have a script for the B4Jbridge using the same method, but you need to be in terminal to use it).
I then used launcher to (right click on desktop) create a desktop launcher for the application, to make sure it executed from the desktop properly (no terminal needed).
I then added using Menu, Preferences, Startup Applications,(from the desktop) and created a startup application using the same script file.
I set my desktop background to our corporate logo, and auto hid the both top and bottom toolbars.
I then edited the startup script to get rid of the unbuntu splash screen etc.
So now when I turn on the system, it launches the B4X application natively and looks very custom.
One thing I forgot to mention is that unfortunately, when you run sudo, it will ask you for a password, this can be cumbersome, so you can get rid of this requirement doing the following:
sudo visudo
This will open the vi text editor for sudo, at the bottom of the file, I added in my case:
microcut ALL=(ALL) NOPASSWD: ALL
and saved it.
Now you can run sudo without the password prompt.
This is a bit rambling, I admit, and I hope this may help or point someone in the proper direction for their system.
I personally am beginning to love the linux environment, and I saw some posts that talked about being able to run the B4J ide in this environment, at some point when I have time I would like to look into that.