Nino
10/12/2026, 1:46 PM.exe or similar using the desktop target and Ktor? I want to share to a friend a small application I made using Kotlin Multiplatform, without them installing a JDK.
I have a cryptic error after the .msi installation and launch of the installed `.exe`: "java/net/http/HttpClient$Version`, followed by a Failed to launch JVM (I though I was building native code, not JVM code ???)
Ofc the ktor documentation is not helping.
The Compose Multiplatform documentation is not really helping either. I tried every command here, at worst it doesn't compile, at best the produced and installed .msi can't launch the application.
The only working example trying to build a shareable binary I could find was this repo https://github.com/JetBrains/compose-multiplatform/tree/master/examples/imageviewer, but it's not using Ktor and I guess the issue is around Ktor on a release?
NB: Launching the debug app from Intellij works fine. I just want to share my application with my non-tech friends.Michael Paus
10/12/2026, 2:41 PMNino
10/12/2026, 2:46 PMNino
10/12/2026, 2:46 PMephemient
10/12/2026, 4:55 PMMichael Paus
10/12/2026, 6:18 PMmodules("java.instrument", "jdk.unsupported", "java.sql", "java.net.http", "java.desktop")
The documentation explains that in more detail.
And set
isEnabled.set(false)
in your ProGuard config block. You can later try to optimize that. Your above errors are all from ProGuard.Nino
10/12/2026, 7:14 PMisEnabled.set(false) followed by runReleaseDistributable made the same error popup happen, but at least I had the error logs on the console (NoClassDefFoundError).
Adding modules("java.instrument", "jdk.unsupported", "java.sql", "<http://java.net|java.net>.http", "java.desktop") as specified here made runReleaseDistributable work.
I would have never guessed I would have to add some JVM stuff in order to Ktor to work in some native target.
Kotlin Multiplatform "Native" desktop is a lie then? We're just building "native" binaries invoking a JVM in the end?
In the end the produced .msi is 70 Mo and once installed, it's 135 Mo. That's a lot! That's such a huge difference compared to the .jar produced by packageUberJarForCurrentOS which is 45 Mo.
Do you know why is it so different?
Anyway, thanks a lot for your help, I've read the documentation 3 times today but it's just so obscure to me 😞Chrimaeon
10/12/2026, 8:27 PM