How do I make the fat jar built by ktor runnable? ...
# ktor
k
How do I make the fat jar built by ktor runnable? Trying to run it only gives
Error: Could not find or load main class ktortest-all.jar
c
It looks like the jar is trying to run with the artifact name as the main class. You need to specify an actual JVM class name in your
build.gradle.kts
file. For example, if your application has your
fun main()
in a file at
src/main/com/example/application.kt
, the class name will be
com.example.ApplicationKt
https://ktor.io/docs/fatjar.html#build
f
did you add next to your build Gradle file?
Copy code
application {
    mainClass.set("your_package.ApplicationKt")
}
where
ApplicationKt
is the file where the
main
is defined
1