07/03/2023, 5:40 PM
Hello I am not sure where to start , but I am looking for a way to run Kotlin code in form of some kind of an app on Windows. Unfortunately this machine does not have Java installed, so I wonder if any kond of workaround is possible. (the app is communicating with REAT APIs and establishing SSH sessions, so I believe it has to be native app rather than "browser JS app") What options do we have here to have standalone app? • Is it possible to build Kotlin app in from of
file running on windows and bundle everything (Kotlin SDK, Java?) entire Kotlin & Java SDKs inside this bundle to un the app even if Java is not installed in the system? • Or would it be better to compile Kotlin to JS and pack it together with some kind of JS runtime (which?)? I would appreciate any feedback and ideas on this

Jeff Lockhart

07/03/2023, 5:44 PM
Kotlin/Native compiles to native binaries, including .exe on Windows. You could use Ktor client in Kotlin/Native.


07/03/2023, 5:47 PM
Any open source project that can present this sample use case? Can exe be compiled on MacOS?


07/03/2023, 5:48 PM
You can also bundle the JVM runtime, like Intelij does.

Landry Norris

07/03/2023, 5:57 PM
Note that Kotlin/Native, especially on Windows may be missing important libraries. You can always use cinterop to call into Windows C apis, but don't expect to be able to use Compose for example from K/N.

Robert Jaros

07/03/2023, 5:57 PM
I think using ssh from kotlin native would be a challenge. I would go with bundled JVM or Kotlin/JS and Electron.


07/04/2023, 12:53 AM
With Java 17 there is jpackage that create redistributable runtime application for different environment:
There should be also gradle/maven plugin for it

Adam S

07/04/2023, 7:49 AM
is it possible to use Docker, Hyper-V, or WSL on the Windows machine?
no red 1

Stefan Oltmann

07/16/2023, 12:00 PM
Any open source project that can present this sample use case? Can exe be compiled on MacOS?
Yes. Windows binary config: macOS binary config: Main method for both: If you stay with POSIX API and only use Kotlin Multiplatform dependencies that include native you will be fine. AFAIK Ktor has full multiplatform support, so your REST client should work without Java. Things change if you need also an UI with Compose. In that case you need to bundle a JVM.