I'm trying to use the getting started with IDEA gu...
# ktor
k
I'm trying to use the getting started with IDEA guide and I'm running into the error
Top-level function 'main' not found in package 'io.ktor.server.netty'
k
I should maybe mention that I'm using IDEA Community
I don't know if that has an impact or not
but still...
o
Do you have netty engine as a dependency?
k
this is my build.gradle dependencies
dependencies { compile "org.jetbrains.kotlinkotlin stdlib jdk8$kotlin_version" compile "io.ktorktor server netty$ktor_version" compile "ch.qos.logbacklogback classic1.2.1" testCompile group: 'junit', name: 'junit', version: '4.12' } mainClassName = 'io.ktor.server.netty.DevelopmentEngine'
o
looks fine…
k
This is my entire build.gradle if that helps?
group 'FastFood' version '0.0.1' buildscript { ext.kotlin_version = '1.2.30' ext.ktor_version = '0.9.1' repositories { mavenCentral() } dependencies { classpath "org.jetbrains.kotlinkotlin gradle plugin$kotlin_version" } } apply plugin: 'java' apply plugin: 'kotlin' apply plugin: 'application' sourceCompatibility = 1.8 repositories { mavenCentral() maven { url "http://dl.bintray.com/kotlin/ktor" } maven { url "https://dl.bintray.com/kotlin/kotlinx" } } kotlin { experimental { coroutines "enable" } } dependencies { compile "org.jetbrains.kotlinkotlin stdlib jdk8$kotlin_version" compile "io.ktorktor server netty$ktor_version" compile "ch.qos.logbacklogback classic1.2.1" testCompile group: 'junit', name: 'junit', version: '4.12' } mainClassName = 'io.ktor.server.netty.DevelopmentEngine' compileKotlin { kotlinOptions.jvmTarget = "1.8" } compileTestKotlin { kotlinOptions.jvmTarget = "1.8" }
My project structure
. ├── main │ ├── kotlin │ │ └── food │ │ └── FoodApp.kt │ └── resources │ ├── application.conf │ └── logback.xml └── test ├── kotlin └── resources
and application.conf
ktor { deployment { port = 8080 } application { modules = [ food.FoodAppKt.main ] } }
o
it works from gradle, so it’s probably fine
and looks ok from first sight
I tried it in IJ just in case, and it works ok
k
do you have any recommendations for me?
looking through the library files, I see that development engine is a .class file and not a kotlin file. Maybe that has something to do with it?
a
I think I have had the same error some time ago. Have you tried reloading your gradle conf?
also just to make sure, clear caches and restart
k
I did both of those
Right now I'm download IntelliJ-U to test if this is just a problem in the community edition
So it seems that IJ-Ultimate is not affected by the problem, but community edition is
@orangy
o
Hmm, that’s weird, but I’ll have to check it. Can you please submit an issue to kotl.in/issue?
k
sure can, I'll do that in a couple of hours.
o
Thanks!