I feel like I must be missing something on the doc...
# multiplatform
z
I feel like I must be missing something on the documentation, I seem to be stuck in a circle trying to find an answer. I want to develop a Native Desktop Application, meaning you can launch the (k)exe on Windows, Mac, or Linux, and be presented with a User Interface. I want the User Interface to be made up of Material Compose Components. I want to define the UI once, and each Desktop Application ends up looking roughly the same. I want this without requiring the machine to have the JVM installed. When I try to find information on this, it seems like everything can be Native, up until the JVM requirement. Then Compose Multiplatform ends up looking like (iOS, Android, JVM, Web). When using the multiplatform wizard and selecting only Desktop, I seem to get JVM targeting code, not native executables anymore. Is it possible to setup a Native Kotlin Material UI Compose Desktop Multiplatform Application?
r
Compose Desktop is JVM based, there isn't a native cross-platform desktop version of Compose that doesn't use the JVM. I believe you can use jlink and jpackage, or perhaps graalvm to take the JVM version and make executables.
👆 1
m
The real question is why you insist on going native (which isn’t possible as already stated above). With the default build pipeline of Compose multiplatform you can already create installers for each of the desktop platforms from a common source set so that the user can just install them on his/her machine without having any JVM installed on it. From the users point of view this is a native application although it uses some JVM modules bundled with the app. (This default pipeline actually uses jlink and jpackage internally too.) I tried GraalVM/native image some time ago but due to some technical problems this didn’t work. GraalVM does not seem to have much interest in desktop programming.
z
The reason I can't use the JVM is due to an organizational policy. Native apps are fine, JVM ones aren't unfortunately. I suppose the alternative would be a different UI library with native bindings?
Thanks though for clarifying that Compose Desktop is JVM only!
Shot in the dark, Compose for Web, Ktor, CIO?
m
I’d rather question this policy. It stems probably from an era where the user had to install a local JRE on his/her machine. Why should an embedded, partial JRE not be OK but a JS or WASM runtime is? (Partial because due to the use of jlink your app only contains the modules which it actually needs and not a full JRE.)
r
If you can use IntelliJ you are already using a JVM?
💯 1
z
That's exactly the situation Michael. It's a bit funky, because nodejs applications are allowed, they have the ability to install Docker and other system admin tools, just not JVM ones.
@ross_a in this case, I'm developing the application outside of the organization, in my free time. Once it's available as a native app, and not JVM, it's "acceptable".
You make a really good point on the Intellij point though, because they were able to independently install Rider, and develop .NET and JS apps with that...
(I presume both Intellij and Rider use the same runtime architecture)