Kotlin runtime and OSGi

I'm curious if there are any plans about OSGi support. It would be nice if the runtime libraries were OSGi-fied, so that Kotlin could be used directly to build OSGi bundles. Alas, the runtime lacks the appropriate manifest entries. Is there any technical obstacle that would prevent proper functionality in OSGi environment, or nobody just raised such a request so far?

I don't think there's any technical obstacle to using Kotlin's runtime in OSGi.

We could add the appropriate entries to the manifest of kotlin-runtime, no problem. Please file an issue in the tracker.
Feel free to contribute your solution too :slight_smile:

Good to hear that there should be no obstacle. I'll look next week, whether I can propose something – hopefully time allows. I guess that bnd could be used to wrap the kotlin-runtime.jar and this could be sufficient for the time being. Anyway, I'll file the issue in the tracker.

I just created an OSGi bundle with an OSGi activator class written in Kotlin. The OSGi bundle includes the kotlin runtime right away without further ado. Was using Karaf and it worked right out of the box.