# Kotlin multiplatform java library with multiplatform module dependency

**URL:** <https://discuss.kotlinlang.org/t/kotlin-multiplatform-java-library-with-multiplatform-module-dependency/12925>\
**Category:** Multiplatform\
**Created:** [June 2, 2019, 6:47am UTC](https://discuss.kotlinlang.org/t/kotlin-multiplatform-java-library-with-multiplatform-module-dependency/12925 "2019-06-02T06:47:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikedawson](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@mikedawson](https://discuss.kotlinlang.org/u/mikedawson)\
**Post date:** [June 2, 2019, 6:47am UTC](https://discuss.kotlinlang.org/t/kotlin-multiplatform-java-library-with-multiplatform-module-dependency/12925/1 "2019-06-02T06:47:21Z")

</div>

Hi,

I really, really like the new multiplatform model. Whilst we can use multiplatform modules as dependencies in other multiplatform projects and Android modules, if I have a Java library and want to use the multiplatform module as a dependency, that doesn’t seem to work.  
e.g.

lib-java-module/build.gradle

```
implementation project(":lib-multiplatform-module")

```

With the above, lib-java-module won’t compile if it has any reference to classes in lib-multiplatform-module. I have also tried:

```
implementation project(path: ":lib-multiplatform-module", configuration: "jvmDefault")

```

Using configuration jvmDefault the module will compile, but it will throw a ClassNotFoundException the first time it encounters any class that is in lib-multiplatform-module. Once using the configuration jvmDefault in the dependency, the gradle dependencies task seems to show the right dependencies.

Is there a better way to consume a kotlin multiplatform module as a dependency in a java module?

Thanks/regards,

-Mike

---

<div class="post-metadata">

**Author:** ![Alexey.Belkov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/alexey.belkov/32/5215_2.png) [@Alexey.Belkov](https://discuss.kotlinlang.org/u/Alexey.Belkov)\
**Post date:** [June 14, 2019, 2:42pm UTC](https://discuss.kotlinlang.org/t/kotlin-multiplatform-java-library-with-multiplatform-module-dependency/12925/2 "2019-06-14T14:42:14Z")

</div>

Thanks for the report. I reproduced this bug and filed an issue here: [https://youtrack.jetbrains.com/issue/KT-31984](https://youtrack.jetbrains.com/issue/KT-31984) If you’re using the 1.3.31 version of Kotlin you should be unaffected. If you believe that your case/project is somehow different, please file a new issue with a sample project to reproduce.
