Search code examples
javakotlinjvmkotlin-multiplatform

Can Kotlin Multiplatform support Java libs?


I became aware of the new Kotlin project (https://kotlinlang.org/lp/multiplatform/). A question occurred to me. I would like to use my Java API in my Kotlin Multiplatform. Would that work? And if not, what is the best thing to do?


Solution

  • Yes, Kotlin Multiplatform can support many Java libraries, such as Mockito, JUnit, and Guava. However, there are a few exceptions, like Reflection. I recommend checking the compatibility guide for more information =) https://kotlinlang.org/docs/multiplatform-compatibility-guide.html#deprecated-support-of-multiplatform-libraries-published-in-the-legacy-mode