About Kotlin

  1. Open source Programming Language
  2. General Purpose
  3. statically typed
  4. run on JVM
  5. Used to develop Android apps and official programming language for Android!
  6. Developed by JetBrains team.

Features of Kotlin

  1. Concise
  2. Interoperable
  3. Null safety
  4. Better compilation Time

Environment Setup

  1. Install JDK (Version >=1.6+ or above)
  2. Setup the JDK and JRE path in local system environment variable.

Run Kotlin in Command Prompt

  1. Download the Kotlin Compiler (file name: kotlin-compiler-1.2.21.zip) from GitHub Releases https://github.com/JetBrains/kotlin/releases/tag/v1.2.21
  2. Extract downloaded zip in any drive location
  3. Copy the path up to bin directory of kotlinc to Environment variables
C:\kotlinc\bin

About Kotlin
Open source Programming Language
General Purpose
statically typed
run on JVM
Used to develop Android apps and official programming language for Android!
Developed by JetBrains team.

Concise
Interoperable
Null safety
Better compilation Time

Install JDK (Version >=1.6+ or above)
Setup the JDK and JRE path in local system environment variable.

Download the Kotlin Compiler (file name: kotlin-compiler-1.2.21.zip) from GitHub Releases https://github.com/JetBrains/kotlin/releases/tag/v1.2.21
Extract downloaded zip in any drive location
Copy the path up to bin directory of kotlinc to Environment variables
C:\kotlinc\bin

Environment Setup

Kotlin Environment Setup

  1. Now save the below code in a text file (notepad), name the file name test.kt and keep the file in E: drive

fun main(args: Array){
println(“Hello World!”)
}

  1. Now open command prompt and from E: drive and rune the below command and press enter.

kotlinc test.kt -include-runtime -d test.jar

  1. After that a jar file named test.jar will be created. Now run the below command to see the output.

java -jar test.jar

  1. Welcome to Happy Kotlin world!
Kotlin Environment Setup

4. Now save the below code in a text file (notepad), name the file name test.kt and keep the file in E: drive

fun main(args: Array<String>){  
    println("Hello World!")  
} 

5. Now open command prompt and from E: drive and rune the below command and press enter.

kotlinc test.kt -include-runtime -d test.jar  

6. After that a jar file named test.jar will be created. Now run the below command to see the output.

java -jar test.jar  

7. Welcome to Happy Kotlin world!

Leave a Reply

Your email address will not be published. Required fields are marked *