Reputation: 1110
I've got a maven (DropWizard) java project. I'd really like to add some Kotlin classes, but seem unable to do so. In my real project I've added the maven configuration like https://kotlinlang.org/docs/reference/using-maven.html#compiling-kotlin-and-java-sources, but my Kotlin classes aren't seen by the 'normal' java code. Neither by maven nor by Eclipse.
So I tried the mixed-source example https://github.com/JetBrains/kotlin-examples/tree/master/maven/mixed-code-hello-world. That worked in Maven, but still not in Eclipse.
What am I missing here?
Upvotes: 4
Views: 3285
Reputation: 311
It seems that there are several issues.
Eclipse doesn't recognize src/main/kotlin
as source directory. To fix it, please add the directory to the classpath manually: properties for mixed-code-hello-world -> Java Build Path -> Source tab -> Add Folder...
Then, try to Remove and Add Kotlin Nature to reindex Kotlin files in the project. To do this, press right-click on the project -> Configure Kotlin -> Remove Kotlin Nature.
I've created tickets for these problems:
Upvotes: 4