# Java file in a multiplatform library

**URL:** <https://discuss.kotlinlang.org/t/java-file-in-a-multiplatform-library/19757>\
**Category:** Multiplatform\
**Created:** [November 2, 2020, 5:40pm UTC](https://discuss.kotlinlang.org/t/java-file-in-a-multiplatform-library/19757 "2020-11-02T17:40:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![carre6810](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@carre6810](https://discuss.kotlinlang.org/u/carre6810)\
**Post date:** [November 2, 2020, 5:40pm UTC](https://discuss.kotlinlang.org/t/java-file-in-a-multiplatform-library/19757/1 "2020-11-02T17:40:01Z")

</div>

Hi,

is it also possible, like in a kotlin project, to use java files?

If yes - what is to do, that ide accept the java file?

 ![ide](https://us1.discourse-cdn.com/flex019/uploads/kotlinlang/original/2X/5/5ce912e4e19f3b23626406c8e6c1306e1cb20c1b.png)

---

<div class="post-metadata">

**Author:** ![arocnies](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/arocnies/32/5143_2.png) [@arocnies](https://discuss.kotlinlang.org/u/arocnies)\
**Post date:** [November 2, 2020, 6:17pm UTC](https://discuss.kotlinlang.org/t/java-file-in-a-multiplatform-library/19757/2 "2020-11-02T18:17:46Z")

</div>

No, you Kotlin does not compile Java code to any of its target platforms other than the JVM target.

If you must use Java code, you can always just compile to Java bytecode since Java bytecode is already portable. You can also compile Java bytecode to JS or to machine code with some third party compilers–which is a very different thing than how Kotlin multiplatform does it.

---

<div class="post-metadata">

**Author:** ![bjonnh](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/bjonnh/32/8106_2.png) [@bjonnh](https://discuss.kotlinlang.org/u/bjonnh)\
**Post date:** [November 3, 2020, 4:47am UTC](https://discuss.kotlinlang.org/t/java-file-in-a-multiplatform-library/19757/4 "2020-11-03T04:47:53Z")

</div>

The only place where you can have java would be in the jvm part of you project, but not in the native, js or commons parts. Have a look at this project: [https://github.com/endanke/kotlin-mpp-framework-skeleton](https://github.com/endanke/kotlin-mpp-framework-skeleton)

---

<div class="post-metadata">

**Author:** ![carre6810](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@carre6810](https://discuss.kotlinlang.org/u/carre6810)\
**Post date:** [November 3, 2020, 7:35am UTC](https://discuss.kotlinlang.org/t/java-file-in-a-multiplatform-library/19757/5 "2020-11-03T07:35:34Z")

</div>

Ok - thanks for the quick responses
