nrobi
01/21/2021, 6:12 AMwithJava() and if it’s really needed by compose?
• If I use it, then my dependencies are not resolved (their jvm() configuration doesn’t contain withJava())
• Otherwise I’m getting Could not find or load main class (not 100% sure if it’s related, but the package name looks okay, so I’m guessing withJava has something to do with sourceSet configuration 🤔)altavir
01/21/2021, 6:15 AMIgor Demin
01/21/2021, 12:13 PMwithJava() was added because application Gradle plugin doesn't work without it.
But now we don't use application plugin for running application, we use our own mechanism.
So we can use only jvm() (without withJava).
Could not find or load main class doesn't happened if we remove withJava in https://github.com/JetBrains/compose-jb/tree/master/templates/multiplatform-template project.
Maybe your main class is inside java folder, not inside kotlin folder?nrobi
01/21/2021, 12:28 PMjvmMain/kotlin/Main.kt with
compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "XY"
}
}
}