Use Kotlin compiler from Java without files?

See this post where I experimented with JSR-223 support and figured out the necessary steps to make it work: Embedding Kotlin as scripting language in Java apps - #8 by davidekholm