B4J Question [Solved] Creating a Linux package with B4JPackager11

aeric

Expert
Licensed User
Longtime User
Referring to the tutorial https://www.b4x.com/android/forum/t...the-simplest-way-to-distribute-ui-apps.99835/

I am confused with the steps explained above.

Where should I extract linux_jdk-11.0.1.zip to?
Answer: I extracted to /home/{user}/jdk-11.0.1

How do I build the package on the target platform?
Answer:
1. Build Release app from B4J IDE in Windows.

2. Copy B4JApp.jar file from Objects folder to Linux /home.

3. Copy B4JPackager11.jar to Linux /home.

4. Create packager.json in Linux /home
B4X:
{
  InputJar: "/home/com/B4JApp.jar",
  IncludedModules: ["jdk.crypto.ec"]
}
*Note: com is my username in Linux

5. Run the following command in Linux:
B4X:
/home/com/jdk-11.0.1/bin/java -jar B4JPackager11.jar packager.json

6. The package is created in /home/com/temp/build

A video tutorial may be much helpful. Thanks.
 
Last edited:

EnriqueGonzalez

Expert
Licensed User
Longtime User
this 2 will give you an insight

compile in linux:

compile in mac:

TLR, download java as you may do usually in linux and connect the IDE with b4j bridge.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
The java openjdk 11.0.8 is missing JavaFX.

I extracted the openjdk 11.0.1 and call java -jar but error show Java not found.

I am using the latest Ubuntu 20.04.1 LTS desktop.

I tried to merge both files, it seems to work. I think this is not a proper way.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

aeric

Expert
Licensed User
Longtime User
I am not sure why when I click on the .sh or run.command in Ubuntu 20.04, it opens TextEditor and doesn't execute the script. When I run using terminal (sometimes with sudo), the script runs.
I found the solution.
Source: https://askubuntu.com/a/1255819

Click the hamburger menu and select Preferences. Go to Behavior tab, under Executable Text Files, select Run them.


 
Upvote 0

BPak

Active Member
Licensed User
Longtime User
Thanks for clear instructions. Used your info to build my apps on LinuxMint 18.2 on my Laptop.
Can copy the build to a USB with a linux format and then copy to other Linux distributions. Works a treat!!!
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Today I am facing issue with building a package under Linux which doesn't include JavaFX.
Finally I found out that I was using B4JPackager version 1.21.
Copy the latest B4JPackager.jar version 1.40 from B4J installation folder to Linux solved the issue.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…