I read the posts that Erel and others pointed to, but it’s not enough. I searched the B4X forum and couldn’t find any complete and working solution for building the “standalone” for macOS.
But I was able to pull together different pieces and got it working like this:
Download OpenJDK as Erel cited above and unzip this to anywhere on your Mac. You will be running the java executable found in the bin folder from a terminal, so making it an easy path is recommended.
Build the standalone app in B4J on Windows. This step is needed to create the jar and json files (couldn’t figure out a way to create these files without doing the full Windows standalone build).
From the resulting Objects folder (parent of the temp/build folder that was just created), copy the <appname>.jar and packager.json files to a folder on the Mac (should use a separate folder because the build process to follow will overwrite the Windows build)
Also copy the B4JPackager11.jar file from your Windows installation of B4J (Program Files (x86)\Anywhere Software\B4J).
Modify the packager.json file to reflect the correct location of the jar file (just remove the entire path if you copied the jar file as directed in step 3).
In a terminal window, change to this folder, then run: <../..>/bin/java -jar B4JPackager11.jar packager.json (replacing <…/…> with the path to the OpenJDK bin folder unzipped in step 1.
This should result in a temp/build folder. This build folder contains everything to run the app on macOS. To run it you have to execute the run.command script from Terminal.
For rebuilding, only copy the jar file (after building the Windows package) and rerun step 6.
Still to do: Figure out how to “package” this build folder into a proper macOS app, and one that doesn’t leave a separate Terminal window behind (there’s talk on the forum of possible ways to accomplish this).
Note that you can add other things to the packager.json file. Some of the options I’ve seen look like this:
You can run it by unzipping the package and clicking on run.command. As I previously wrote there is place for improvement here and this is not the case with Windows packages (which are simpler to create and include an executable).
This does not work, as I mentioned in my step-by-step post. I just tried it again on another Windows 10 computer to make sure it wasn’t an issue with my VM. The only option I found that produced the compiled jar file is to run “Build Standalone Package” on Windows.
So I tried to move the exe somewhere else and it wouldn’t run. Then I moved the entire build folder somewhere else and it ran. The build folder is about 48 MBs on my machine. Not sure if all the folders/files therein are needed or not.
Again, as I stated in my step-by-step post, there’s not a complete and working procedure anywhere that I could find. This is one more detail to add.
Edit: This creates the jar file, but not the json file. If you’re going to build the Mac package from Terminal, you’ll need this (or just create it - format is included in my post above). If you are going to use the remote-debug method that Erel laid out, then you don’t need the json file.
Couple of weeks dabbling with B4A and in some areas Im impressed.
But currently I think Im running into possible memory issues under Android. I have a couple of million element int arrays which represent something like a map, and when that ‘map’ is fully populated the tablet slows to a crawl / doesn’t refresh the screen
Working on optimising it but I have feeling it may not scale as I would like.
This isnt a rant, and may be due to inexperience.