Ktor: Can't deploy using jar

Created on 10 Apr 2018  路  6Comments  路  Source: ktorio/ktor

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?

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.

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diaodou picture diaodou  路  3Comments

scorsi picture scorsi  路  4Comments

chrisjenx picture chrisjenx  路  4Comments

ManifoldFR picture ManifoldFR  路  4Comments

baruchn picture baruchn  路  3Comments