I generated a new Ktor project using the IntelliJ ...
# ktor
p
I generated a new Ktor project using the IntelliJ plugin. The resulting build.gradle file has mainClassName = “io.ktor.server.netty.EngineMain” but when I build a fat Jar with Gradle I get java.lang.ClassNotFoundException: io.ktor.server.netty.EngineMain.
r
Hi, I'm experiencing the exact same problem. I filed a bug report: https://github.com/ktorio/ktor/issues/1823
@ponzii, I found the problem in my case. Explanation in the comments of that issue^
p
Thanks. I’ve given up on Ktor and Kotlin after battling with the various entanglements of Kotlin/Gradle/IntelliJ and wasting nearly a whole week trying to produce a Jar. I don’t think Kotlin simplifies anything relative to Java, though I’m not a Java fan. There’s just so much get right - source vs build versions. Gradle Kotlin version vs app Kotlin version. Having to specify the language/JDK version in 4 different places in IntelliJ. It’s a complete time-sink.
Added to all this is the slow refresh times during development.
From what I’ve seen of the bug reports Ktor is not ready for production. Too many issues.
r
Too bad you're experiencing these problems. Myself I'm new to Ktor as well, but not to Kotlin. But I have similar experiences when trying new technologies/frameworks. I agree that you don't want to spend time on these kind of problems. But also, when getting more experienced you know what to do or where to look for to solve them.
According to
4 different places in IntelliJ
I configure everything in Gradle, Then IntelliJ should pick that up automatically. In general you do not want to have to configure these kind of things in your IDE itself redundantly.