I thought this was what"multiplatform" was but now not sure

I’ve written a small desktop app in kotlin
I’d like to give it to friends.
I don’t know what the friends have on their machines: Mac or PC, or if they have a JRE installed.
And the dependent libraries make it WAY too big for an Uber-JAR (600mb once you include libs for Windows+Mac+Linux)

I thought that multiplatform was the solution to this: something where it would generate three small executables, and the executables were stand-alone, and when they first run their executive it would download and cache their platform specific dependencies.

… not so much? Is there anything that does this?

1 Like

It sounds like your real question is

How do I let my friends run my Kotlin application?

There’s a bunch of context questions to consider. What build tool, what kind of desktop app, how do you expect your friends to use it (run from CLI, launch container, double clicking a file?).

If you’re looking for an easy way to distribute your app, and assuming you are using Gradle, you can use the application plugin.
That’s likely much easier than rewriting your app to target native platforms, spending a bunch of time learning new platforms and removing java stdlib dependencies (and replacing all of your other dependencies).

2 Likes

You could do that, but it means targeting kotlin native through multiplatform, and I’m not sure how far along that is exactly, and I can imagine it to be quite a hassle. Almost certainly too much for “a small desktop app”.
No, in this case you build for the JVM, which already is multiplatform, and available for every desktop OS out there. Either ask your friends to install JRE, or (recommended) you package your application together with a JRE for the specific platform using something like jpackage or launch4j. There are other libraries providing the same service.

3 Likes

I’ve used jpackage to bundle a commercial java application (JavaFX based) for deployment to mac and windows. Linux would easily fit into that but there was no need. It’s quite good, but it has it’s limitations. Much better than asking friends to install jre.

1 Like

been there done that :joy: :rofl: :sweat_smile: kotlin is not good for that
not good for any sort of front end except maybe android
use tkinter for a desktop app