Followed instruction here https://ktor.io/servers/deploy.html for fat jar deployment
When I run java -jar myjar.jar , i get main class could'nt be found in io.ktor.server.netty.DevelopmentEngine.
Project runs fine in IDEA
Any idea why?
Were you able to overcome this issue?
My team is facing the exact same error and we're running out of ideas already.
I'm guessing this Deployment article is outdated, so if anyone could point me the right direction I'd be immensely grateful!
@italonascimento
mainClassName = 'io.ktor.server.netty.EngineMain' is for Ktor 1.0.0-beta-3. Which version are you using?
Before it, it should be:
mainClassName = 'io.ktor.server.netty.DevelopmentEngine'
Hi @soywiz.
I wasn't able to deploy using mainClassName = 'io.ktor.server.netty.DevelopmentEngine' either, but after some time I finally deployed a working version using mainClassName = 'MainKt' instead.
Following the tutorial to generate FatJar using Gradle, I had the exact same problem and I solved by changing the mainClassName in build.gradle file from "io.ktor.server.netty.EngineMain" to "my own path to main application". Thanks a lot @italonascimento! Hope they update the documentation soon.
This issue has been automatically marked as stale because it has not had recent activity.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Most helpful comment
Following the tutorial to generate FatJar using Gradle, I had the exact same problem and I solved by changing the mainClassName in build.gradle file from
"io.ktor.server.netty.EngineMain"to"my own path to main application". Thanks a lot @italonascimento! Hope they update the documentation soon.