You can locally redirect the Kotlin script cache directory to capture the compiled jar, but it still depends on the Kotlin script artifact which is large, has lots of dependencies, and are still quite dynamic. fun main(vararg args: String) { if (args.size == 2) { - val old = args[0].let(::File).readText() - val new = args[1].let(::File).readText() + val old = args[0].let(Paths::get).let(Paths::readString) + val new = args[1].let(Paths::get).let(Paths::readString) If you are building a JVM binary or a JVM library which shades dependencies make sure you use a tool like R8 or ProGuard to remove unused code paths, or use a Graal native image to produce a minimal native binary.