Installation and Setup
Installation and Setup
Prerequisites
Before installing Kotlin, make sure you have the following:
- Java Development Kit (JDK) – Kotlin runs on the JVM, so JDK 8 or higher is required.
- Internet connection – To download the necessary tools.
Step 1: Install JDK
Download and install JDK from the official Oracle or OpenJDK website.
Check if JDK is installed:
java -version
Expected output:
java version "17.0.x" ...
Step 2: Install Kotlin
Option A: Using SDKMAN (Linux/macOS)
# Install SDKMAN
curl -s "https://get.sdkman.io" | bash
# Install Kotlin
sdk install kotlin
Option B: Using Homebrew (macOS)
brew install kotlin
Option C: Using Snap (Ubuntu/Linux)
sudo snap install kotlin --classic
Option D: Manual Installation (Windows/All Platforms)
- Download the Kotlin compiler from kotlinlang.org.
- Extract the ZIP archive.
- Add the
binfolder to your system PATH.
Verify installation:
kotlinc -version
Expected output:
kotlinc-jvm 1.9.x (JRE 17.x.x)
Step 3: Set Up an IDE
IntelliJ IDEA (Recommended)
- Download IntelliJ IDEA from jetbrains.com/idea.
- The Community Edition is free and fully supports Kotlin.
- Kotlin plugin is bundled by default — no additional installation needed.
Android Studio
- Download from developer.android.com/studio.
- Kotlin is pre-installed and ready for Android development.