# Is there a Kotlin equivalent of javax.tools.JavaCompiler?

**URL:** <https://discuss.kotlinlang.org/t/is-there-a-kotlin-equivalent-of-javax-tools-javacompiler/23575>\
**Category:** Uncategorized\
**Created:** [December 2, 2021, 12:59am UTC](https://discuss.kotlinlang.org/t/is-there-a-kotlin-equivalent-of-javax-tools-javacompiler/23575 "2021-12-02T00:59:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikesamuel](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/mikesamuel/32/7012_2.png) [@mikesamuel](https://discuss.kotlinlang.org/u/mikesamuel)\
**Post date:** [December 2, 2021, 12:59am UTC](https://discuss.kotlinlang.org/t/is-there-a-kotlin-equivalent-of-javax-tools-javacompiler/23575/1 "2021-12-02T00:59:44Z")

</div>

I’m writing a code generator and it might evolve in the direction of hot-swapping code in the JVM. Writing it in Java would let me do that by invoking the compiler programattically. Is there a way to do that with kotlinc that doesn’t involve creating temporary files and/or shelling out?

---

<div class="post-metadata">

**Author:** ![Meodinger](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/meodinger/32/9028_2.png) [@Meodinger](https://discuss.kotlinlang.org/u/Meodinger)\
**Post date:** [December 12, 2021, 6:06am UTC](https://discuss.kotlinlang.org/t/is-there-a-kotlin-equivalent-of-javax-tools-javacompiler/23575/2 "2021-12-12T06:06:20Z")

</div>

You can try [tschuchortdev/kotlin-compile-testing on Github](https://github.com/tschuchortdev/kotlin-compile-testing)

---

<div class="post-metadata">

**Author:** ![darksnake](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/darksnake/32/2479_2.png) [@darksnake](https://discuss.kotlinlang.org/u/darksnake)\
**Post date:** [December 12, 2021, 9:26am UTC](https://discuss.kotlinlang.org/t/is-there-a-kotlin-equivalent-of-javax-tools-javacompiler/23575/3 "2021-12-12T09:26:30Z")

</div>

Scripting does that: [KEEP/scripting-support.md at master · Kotlin/KEEP · GitHub](https://github.com/Kotlin/KEEP/blob/master/proposals/scripting-support.md)
