I have a JEE project that is purely Java and I have turned it into a Java and Kotlin mixed codebase. I have been using JRebel and when I save a change to a Java class, it is automatically compiled, placed in the project /bin
directory as a .class
file, and the change is automatically picked up by JRebel and deployed to my running web application.
Now when I save a change to a Kotlin class, it does not get automatically compiled, thus there is no new .class
file in the /bin
directory and JRebel, therefore does absolutely nothing.
This problem is mentioned in the comments of the JetBrains Kotlin Blog (https://blog.jetbrains.com/kotlin/2015/06/kotlin-eclipse-plugin-0-2-0-2/) and has a ticket in the JetBrains Kotlin tracker (https://youtrack.jetbrains.com/issue/KT-8123 - it has be languishing there for about a year). The Eclipse Kotlin plugin is failing to compile the class file on save for incremental builds. See this related posting: https://stackoverflow.com/a/36259756/2346823
I've found I can trick the Kotlin plugin to create the class file by running a program that uses them - but this is super stinky...
Has anyone figured out how to make the Eclipse Kotlin plugin automatically compile and build the .class
file when the source file is saved? Any other hints or tricks would be welcome (other than, "Switch to IntelliJ IDEA")
Thank you.