In this question the basic configuration of Kotlin + Java + Gradle in Eclipse is described. It allows me to create Kotlin code. The Kotlin and Java natures are correctly present. Unfortunately, the code does not run. Not as Kotlin application nor as JUnit test.
When my (i.e. created by me) Kotlin class is called from Java code, it yields a NoClassDefFoundError. When the same test/application is run from Gradle or IntelliJ the code runs correctly.
My investigation thus far has uncovered that the class files in the bin folder are not there to be found when executing.
Using the buildship plugin
The image below shows that the
src tree exists. All Java compile classes are in the
src tree. The
kotlin_bin folder has the correct folders, but no files.
Using gradlew eclipse and import .project files
This results in the same behavior. I prefer buildship to manage gradle.
Any tips on how to proceed? I would like to be able to run in Eclipse. We’re adding a small Kotlin part to the project, I would prefer not to force my team to switch to IntelliJ.
This issue seems to be an issue with the Eclipse plugin. See KE-344. All symptoms seem to match.