Skip to content

Instantly share code, notes, and snippets.

@reline
Last active August 5, 2020 04:14
Show Gist options
  • Save reline/ad0ebffecb23c904d98ebc2c103a4cff to your computer and use it in GitHub Desktop.
Save reline/ad0ebffecb23c904d98ebc2c103a4cff to your computer and use it in GitHub Desktop.
Kotlin Multiplatform JVM workaround
// java.lang.ClassNotFoundException
// java.lang.NoClassDefFoundError
// Could not find or load main class
// https://youtrack.jetbrains.com/issue/KT-29082
task execute(type: JavaExec) {
main = "com.github.MainKt"
classpath = objects.fileCollection().from(
tasks.named("compileKotlin"),
tasks.named("compileJava"), // if you have java sources or generated java sources
configurations.named("runtimeClasspath")
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment