The Kotlin compiler analyzes Kotlin source and translates it into executable output for several targets. For Kotlin/JVM, it turns .kt files into .class files that the JVM can run, then packages them using the application’s standard procedure. section 1.5.2
Compile and run a JVM program
A minimal command-line workflow is: kotlinc <source file or directory> -include-runtime -d <jar name> java -jar <jar name> The compiler produces JVM bytecode and the packaged JAR includes the Kotlin runtime library. That library supplies Kotlin classes such as Int and String and extensions to standard Java APIs. The JVM does not need to know whether the bytecode began as Java or Kotlin. section 1.5.2
Compilation also removes mechanical boilerplate from Kotlin source. The compiler can generate methods such as equals, hashCode, and toString for data-oriented classes. It also determines whether properties need backing fields: referencing field or using a default accessor requires storage, while a purely computed property does not. section 4.3 section 4.2.4
kotlinc <source file or directory> -include-runtime -d <jar name> java -jar <jar name>
Use the command listing to navigate the complete compile-and-run workflow for a Kotlin/JVM program. section 1.5.2
