Kotlin is very similar to Java, and so, as Java, Kotlin has compiler. Let’s see now how build process is working in Kotlin.
All source code is stored in .kt files that are organized in packages. This is the same as in Java, the only difference is that Java uses .java extension. Kotlin compiler analyzes source code and generates .class files (as Java does it too). Then, .class files are packaged – the way in which they are package depends on kind of project you are working on.
Like this you can compile and run your code. For example create some .kt source code, then compile it using kotlinc, Kotlin compiler, and finally run it using Java:
$ kotlinc First.kt -include-runtime -d First.jar
$ java -jar First.jar