First Kotlin Program Using Command Line

To write Kotlin program, we can use any text editor like: Notepad,Notepad++ , sublime .

  Save the file with name First.kt , .kt extension is used for Kotlin file.


How to Compile Kotlin File

Open command prompt and go to directory location where file is stored. and type follwing command.


fun main(args:Array<String>)
{
println("This is our first kotlin program");

}
This is our first kotlin program

How to Run Kotlin Program

To run the Kotlin .jar (First.jar) file run the following command.

java -jar First.jar