KT Kotlin

Kotlin: Running Code & Tools

Compiling and running

# Compile to JAR and run via Java
kotlinc main.kt -include-runtime -d app.jar
java -jar app.jar

# Kotlin CLI (simple scripts)
kotlin main.kt

Editors / IDEs

  • IntelliJ IDEA — Kotlin was created by JetBrains, so IntelliJ has the best Kotlin support (free Community edition works).
  • Android Studio — built on IntelliJ, includes Kotlin out of the box for Android development.
  • VS Code — install the Kotlin extension by Kotlin (kotlin-language) for basic support.

Build system: Gradle

Real-world Kotlin projects use Gradle (with the Kotlin DSL or Groovy):

# Create a new Kotlin project
gradle init --dsl kotlin --type kotlin-application
gradle build          # compile + test
gradle run            # run the application
./gradlew build       # wrapper (no local Gradle needed)

Kotlin for Android

Kotlin is the recommended language for Android development. Android Studio creates new projects with Kotlin by default. Key differences:

  • Android uses a subset of the Kotlin standard library (no reflection-heavy features)
  • Jetpack Compose (the modern Android UI toolkit) is Kotlin-first
  • Coroutines (launch, async) are the standard way to handle async work on Android

Kotlin Multiplatform (KMP)

Kotlin can compile to JVM (server), JavaScript (web), and native (iOS, desktop) — all from the same codebase. This is called Kotlin Multiplatform.

Quick check below!