Samuel
06/21/2025, 4:30 AMdesktopRun -DmainClass=io.github.samuelmarks.off_on_ml.MainActivity --quiet
• desktopRun -DmainClass=<http://io.github.samuelmarks.off_on_ml.App|io.github.samuelmarks.off_on_ml.App> --quiet
• desktopRun -DmainClass=io.github.samuelmarks.off_on_ml.Greeting --quiet
• desktopRun -DmainClass=io.github.samuelmarks.off_on_ml.Platform --quiet
• desktopRun -DmainClass=io.github.samuelmarks.off_on_ml.Platform.jvm --quiet
• desktopRun -DmainClass=io.github.samuelmarks.off_on_ml.main --quiet
• desktopRun -DmainClass=io.github.samuelmarks.off_on_ml --quiet
SaurabhS
06/21/2025, 4:48 AMApp
, you need to use AppKt
as class name.Samuel
06/21/2025, 4:51 AMMain method not found in class io.github.samuelmarks.off_on_ml.AppKt, please define the main method as:
From repo root, all .kt files:
composeApp/src/androidMain/kotlin/io/github/samuelmarks/off_on_ml/MainActivity.kt
composeApp/src/androidMain/kotlin/io/github/samuelmarks/off_on_ml/Platform.android.kt
composeApp/src/commonMain/kotlin/io/github/samuelmarks/off_on_ml/App.kt
composeApp/src/commonMain/kotlin/io/github/samuelmarks/off_on_ml/Greeting.kt
composeApp/src/commonMain/kotlin/io/github/samuelmarks/off_on_ml/Platform.kt
composeApp/src/commonTest/kotlin/io/github/samuelmarks/off_on_ml/ComposeAppCommonTest.kt
composeApp/src/desktopMain/kotlin/io/github/samuelmarks/off_on_ml/Platform.jvm.kt
composeApp/src/desktopMain/kotlin/io/github/samuelmarks/off_on_ml/main.kt
composeApp/src/iosMain/kotlin/io/github/samuelmarks/off_on_ml/MainViewController.kt
composeApp/src/iosMain/kotlin/io/github/samuelmarks/off_on_ml/Platform.ios.kt
composeApp/src/wasmJsMain/kotlin/io/github/samuelmarks/off_on_ml/Platform.wasmJs.kt
composeApp/src/wasmJsMain/kotlin/io/github/samuelmarks/off_on_ml/main.kt
Samuel
06/21/2025, 4:52 AMjw
06/21/2025, 4:57 AMjw
06/21/2025, 4:58 AMSamuel
06/21/2025, 5:13 AMdesktopRun -DmainClass=io.github.samuelmarks.off_on_ml.OffOnMl.MainKt --quiet
Olivier Patry
06/21/2025, 6:59 AMobject Main
where the main
function resides.
mainApp.kt
(at root of source folder)
object MainApp
fun main() {
...
}
In mymodule/build.gradle.kts
plugins {
alias(libs.plugins.jetbrains.kotlin.jvm)
...
}
compose.desktop {
application {
mainClass = "MainAppKt"
...
}
}
To launch it
./gradlew :mymodule:run --quiet
Olivier Patry
06/21/2025, 7:02 AMhfhbd
06/21/2025, 7:39 AMhfhbd
06/21/2025, 7:43 AMzsmb
06/21/2025, 10:42 AMmoduleName [desktop]
run config which is set up correctly already.
If that's not the case, and you could share the project in a YouTrack issue, that'd be really helpful: https://youtrack.jetbrains.com/newIssue?project=KMTSamuel
06/21/2025, 3:46 PMSamuel
06/21/2025, 3:51 PM