We can write kotlin programs in text editor and run the programs using command line. We need kotlin complier for this . we can download KOTLIN COMPILER FROM HERE .
3. Copy the path of bin (C:\Program Files\kotlin\bin) and add it your to PATH in System variable.
If you do not know how to add path in system variable , you can use the following link
7. I have saved my helloworld.kt file in Documents folder , so i am changing my directory to Documents (you have to change it to your directory where the file is saved)
1. Download kotlin-compiler -1.3.72.z.ip
2. Unzip Kotlin compiler to program files in c drive
3. Copy the path of bin (C:\Program Files\kotlin\bin) and add it your to PATH in System variable.
If you do not know how to add path in system variable , you can use the following link
4. Now open notepad and write your kotlin program
fun main(args: Array<String>) { println("Hello World") }5. save the program as helloworld.kt , i have saved it to my Documents
6. Open cmd
cd documents
8. Compile the kotlin program using the following command
kotlinc helloword.kt -include-runtime -d helloworld.jar
9. Run the program using the following command
java -jar helloworld.jar
Comments
Post a Comment