Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Install the Kotlin Compiler on Windows

Download the Kotlin compiler from GitHub, extract it and add it to the PATH.

Windows Hosting2 min read12 steps5 screenshots

Before you start

Kotlin runs on the JVM, so install a JDK first and check it with java -version.

Step 1: Download Kotlin from GitHub

Open the Kotlin releases page on GitHub and download the kotlin-compiler-x.y.z.zip file from the latest release.

The Kotlin compiler releases page
Downloading the compiler

Step 2: Extract the file

Extract the zip to a folder, such as C:\kotlinc. The tools are in C:\kotlinc\bin.

Extracting the compiler

Step 3: Add the bin folder to the PATH

  1. Search for environment variables in the Start menu and open Edit the system environment variables. Click Environment Variables.
  2. Select Path under System variables and click Edit.
  3. Click New and add C:\kotlinc\bin.
  4. Click OK in all windows.
    Adding Kotlin to the Path

Step 4: Check the install

Open a new Command Prompt:

kotlinc -version
The Kotlin compiler version

Try it

Create hello.kt:

fun main() {
    println("Hello, Kotlin!")
}

Compile and run:

kotlinc hello.kt -include-runtime -d hello.jar
java -jar hello.jar

Features of Kotlin

  1. Concise syntax.
  2. Null safety.
  3. Java interoperability.
  4. Extension functions.
  5. Coroutines for asynchronous code.
  6. Data classes.
  7. A strong community and tools (IntelliJ IDEA and Android Studio).
  8. Multiplatform development.

Quick recap

  • Install a JDK, extract the compiler and add bin to the PATH.
  • Check with kotlinc -version.
  • Compile with kotlinc and run with java -jar.