I\'m working on a Java project and within this project I did my first try with Kotlin. I started converting some classes to Kotlin with the JavaToKoltin converter provided i
This error is likely due to the fact that the simple jar task doesn’t take all its runtime dependencies.
From gradle documentation, In your build.gradle.kts you can either create a "fatJar" task or add that to your jar task:
tasks.withType {
// Otherwise you'll get a "No main manifest attribute" error
manifest {
attributes["Main-Class"] = "com.example.MainKt"
}
// To add all of the dependencies
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}