I can't get Kotlin to run on a fresh project with ...
# getting-started
p
I can't get Kotlin to run on a fresh project with IDEA. When I mark /src as Sources Root, I get the message "Kotlin not configured" above the file. No idea whats going wrong
m
If you’re using Gradle to build, then in IDEA, create a new project from existing sources, and point to the directory containing the build.gradle file. IntelliJ will ‘read’ the Gradle file, and setup your project for you. No need to manually configure the project, or source sets, or anything else
Also, the
src
folder doesn’t get marked as a source root. This assumes you have the standard Maven/Gradle folder structure, where your kotlin code lives in
src/main/kotlin
. You’d mark the kotlin folder as a source root.
p
that worked. Thanks
m
and if you change your gradle file, IntelliJ will update automatically (if you turned on auto-import), or prompt you to refresh the project otherwise