Michael
Michael

Reputation: 5072

Eclipse RCP: PDE export and Kotlin

I have an Eclipse RCP application and added a class written in Kotlin (I added the Kotlin Eclipse plugin, the Kotlin libraries etc.) So far everything works great and I can call the Kotlin class from another Java class when I start the application inside of Eclipse (via Launch an Eclipse Application).

Now, I want to export the application using the PDE export wizard (Export > Plugin-Development > Eclipse Product). However, this does not export compiled Kotlin class but exports it like a normal package resource (so mypackage/MyClass.kt instead of mypackage/MyClass.class).

Can I configure the PDE Build / Export so that it exports the compiled Kotlin classes?

Upvotes: 0

Views: 538

Answers (1)

Xavier Bouclet
Xavier Bouclet

Reputation: 1012

I had both the kt file and the class file in the exported jar. You can try to remove the kt file in the bin folder. I haven't had any success when using a different source folder for my kt files.

Anyway no problem using the jar with the kt file in it.

I tried excluding the kt file and adding the kotlin_bin folder in my source folders without success either.

I am going to try with Maven and tycho-compiler-plugin.

The only trouble I really had was that I had to add the kotlin-runtime.jar to the exported product to make it work.

Upvotes: 1

Related Questions