# Kotlin compiling java files

**URL:** <https://discuss.kotlinlang.org/t/kotlin-compiling-java-files/2503>\
**Category:** Language Design\
**Created:** [April 18, 2017, 12:16pm UTC](https://discuss.kotlinlang.org/t/kotlin-compiling-java-files/2503 "2017-04-18T12:16:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![niyaz.nigmatullin](https://avatars.discourse-cdn.com/v4/letter/n/df705f/32.png) [@niyaz.nigmatullin](https://discuss.kotlinlang.org/u/niyaz.nigmatullin)\
**Post date:** [April 18, 2017, 12:16pm UTC](https://discuss.kotlinlang.org/t/kotlin-compiling-java-files/2503/1 "2017-04-18T12:16:55Z")

</div>

`kotlinc` can compile kotlin files, that use Java classes, even if Java classes are given as source files. So `kotlinc` in some way compiles them, but doesn’t make binary `*.class` files. Even when we put it into `*.jar` executable.

After compilation this `*.jar` executable can’t be executed.

Why wouldn’t `kotlinc` compile java files and put them to `*.jar` executable, so that the program can be executed?

---

<div class="post-metadata">

**Author:** ![yole](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/yole/32/1425_2.png) [@yole](https://discuss.kotlinlang.org/u/yole)\
**Post date:** [April 18, 2017, 12:43pm UTC](https://discuss.kotlinlang.org/t/kotlin-compiling-java-files/2503/2 "2017-04-18T12:43:13Z")

</div>

Because we see no reason to spend extra effort on supporting bytecode generation from Java source code when there are plenty of possibilities to compile Java and Kotlin together using the Java and Kotlin compilers.
