B4J Question B4J jar to Linux

DarkoT

Active Member
Licensed User
I'm starting with B4J on Windows10 and I was really positive surprised how "smooth" is to create UI application. I created my first App and this works on all Windows 10 machines. In company we have about 20 Linux machines...

I try to distribute this app to Linux - and app will not start... Nothing happens on Linux, when I try to execute jar (with launcher; I gave the system all rules that Jar can be executed)…

I update everything, I was try to update/downgrade version of Java (everything from version 8 - to latest Java version - 15), I try with OpenJDK (version 11) – still will not working…



I read every detail in this forum; maybe I’m not smart enough to understand the logic…

Which version of Java should I use to compile app to Jar that this will work on Win10 and on Linux machines?! Which version should be installed on Linux and Windows, that this jar can be executed…



Sorry, this is really annoying, but – I’m without any Ideas what should I do, that this will work…

(this is more like my last scream before I raise my hands and reinstall every Linux comp to windows ☹) – or to switch to some web app …(and – yes – I’m coming from windows World, I beginner in Linux world and also – new in B4J) ☹



Thanks for help…

Darko
 

aeric

Expert
Licensed User
Longtime User
Are you using B4JPackager11 ?
 
Upvote 0

DarkoT

Active Member
Licensed User
No, I'm not familiar with B4JPackager11. I was try to create, but this will create a EXE (for windows installation) or ?! ... Basically I just need to create simple JAR and copy it to another machine (windows, linux, ...)...

(If you can help me - you will get 200 coffee's)
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
You need to use this tool in the IDE to create the json file. Of course it will also create the exe. You will then need to edit the path in json file and run using B4J Bridge in Linux.
 
Upvote 0

DarkoT

Active Member
Licensed User
Ok, thanks... I will try... Which java should I use? Java 11? Or can I stay on Java 8?

In any case - I will give you echo with result...

Tnx...
 
Upvote 0

DarkoT

Active Member
Licensed User
Okay, no I have created EXE with a B4JPackager11 ... And now? What should I change (witch file) and what should I copy to Linux - all this stuff? And which Jar should i Start?

(sorry for bugs you with this; it's really annoying - from my point of view - to complicated...)

 
Upvote 0

DarkoT

Active Member
Licensed User
And result is the same as before... I copy everything to Linux Machine, try to start jar.jar ... Nothing... Btw - on Windows can I normally run java -jar jar.jar and working...
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
And result is the same as before... I copy everything to Linux Machine, try to start jar.jar ... Nothing... Btw - on Windows can I normally run java -jar jar.jar and working...
Copy B4JBridge to Linux. B4J Bridge will help you download all the application files from Windows to Linux.
Download B4JBridge here:
 
Upvote 0

DarkoT

Active Member
Licensed User
Why B4J Bridge?! It's not possible just to copy generated jar to Linux and start it?! Maybe I really not understand the logic how to create just simple jar from B4J for Linux...
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
In windows development machine, you already have all the required libraries but not in the target machine. The packager make it easy so you don’t need to install Java on the target machine. The jar needs some libraries/dependencies runtime files to run the UI application. Once you done for one machine, you can copy to another machine using USB disk or through terminal.
 
Last edited:
Upvote 0

DarkoT

Active Member
Licensed User
OOO... I'm little bit closer to solution... I added B4j-bridge to one linux comp and successfully connected B4j over brigdge... But - stil not working... When i try to compile solution and sent over bridge to linux, receive a error:


- in picture:



any ideas? Additional help will be --> ufff...
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
I can't see the log. Can you copy and paste the text?

If you follow this tutorial, you will see that you need to modify the InputJar path.
B4X:
Private InputJar As String = "/users/username/Downloads/AngryBirds.jar"
or use the packager.json in Linux.
 
Last edited:
Upvote 0

aeric

Expert
Licensed User
Longtime User
You may also need OpenJDK 11 + OpenJFX 11 (SDK + jmods)


Sorry, I can't remember clearly how I did this last year. Please post your error message if still not succeed.
 
Upvote 0

DarkoT

Active Member
Licensed User
Aeric - you are my new best friend.... Now works... It's really complicated to solve all this combinations, but - now it's working. You helped me definitely and you deserve to get a coffee... I'm sure, I'm not only one which is confused with all this linux-win-mobile-web combinations... Everything on end sounds logical, but is hard to find all solutions on one place... In any case - many thanks and 'm sure that other developers will be more as thanks-full for this help...

@Erel (and others) has made a beautiful environment which can be very very useful for rapid development... I'm proud that can be a part of this community... And - I'm sure - this community will grow...

I will close this case...

Tnx, Darko
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…