UI apps -
If you are using Java 8 then the compiled jar will work on Linux, Windows and theoretically Mac (practically running on Mac is more
complicated).
Better to use Java 11 and create a package:
https://www.b4x.com/android/forum/t...lest-way-to-distribute-ui-apps.99835/#content
Using the external packager, you can create a package for Linux.
Non-UI / server - compiled jar will work on all platforms, Java version is not important (Mac still requires notarization).
You can also build a package for non-ui apps but it is mostly not needed.