https://kotlinlang.org logo
h

hiperbou

11/20/2018, 2:59 PM
I'm adding the application plugin to the MPP 1.3.10 template 'Kotlin (JS Client/JVM Server)' and I always get the error "could not find or load main class 'sample.SampleKt' " Is there any example of using the application plugin in a multiplatform project?
h

hiperbou

11/21/2018, 11:53 AM
Thanks Alexey, I found the error comparing my project with this one. In the default template aswell as in the documentation, uses "fromPreset(presets.jvm, 'jvm')" while in this example "presets.jvmWithJava" is used instead. So I switched this and is working as expected. I can't find this preset anywhere in the documentation. What's the difference between jvmWithJava and jvm?
a

Alexey Belkov [JB]

11/21/2018, 12:09 PM
Quoting from https://github.com/h0tk3y/k-new-mpp-samples/blob/master/README.md:
jvmWithJava is a preset for JVM that is coupled with the Gradle java plugin and defines a Kotlin compilation per Java source set; this preset is likely to be removed in the future once jvm gets support for compiling Java;
See also related issues: https://youtrack.jetbrains.com/issue/KT-26256
👍 1
h

hiperbou

11/21/2018, 2:07 PM
As this README is labeled as obsolete, and even gives a link to the official documentation, I think that the preset should be listed here too, at least until it gets finally removed: http://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#supported-platforms
a

Alexey Belkov [JB]

11/21/2018, 2:15 PM
This is almost certainly intentional. In any case, please leave a comment about it in
<https://youtrack.jetbrains.com/issue/KT-26256>
so we will have some kind of historical record of this decision.