So I’m slowly adding Kotlin code to my existing java project, however, when I want to call a function from a KT file I run into some issues.
I want to call this function from a java section in my project, so in order to achieve this I have to recreate the same function in a companion object like so:
And then in the java code (this code needs to run after pressing a button in a javaFX UI)
However, the moment I try to run I’m met with the following errors:
This is what the project structure looks like:
Am I just trying to implement this wrong? Or is calling a Kotlin function outside of Kotlin not a thing?