Skip to content

Setup: Your Development Environments

Helpful Resources
  1. About IntelliJ IDEA
  2. Setup: IntelliJ IDEA
  3. Setup: Command Line Compiler
  4. Setup: Eclipse
  5. Setup: Learners Guides
  6. About: Android Studio IDE
  7. StackOverflow: Android Studio vs. IntelliJ
  8. JetBrains Toolbox App
  9. EduTools Plugin
  10. Getting Started With Kotlin
  11. Manage multiple IDEs & Releases with Toolbox App
  12. VSCode: Kotlin Language Plugin
  13. VSCode: Code Runner plugin
  14. VSCode: Setup for Kotlin Development

1. Introduction

What are my development environment options?

Kotlin offers multiple options for development environments:

Which one should I use?

After some research, I recommend the following:

  • Install the JetBrains Toolbox App to manage multiple IDE versions (stable, canary releases) or variations. This was a popular developer suggestion on StackOverflow especially when you start moving to Android Studio for native development.

  • Use IntelliJ when you first get started. It's maintained & recommended by JetBrains ("go where the devs are") and has built-in Learners Guides that help you skill up fast. This was also the basis for the Android Studio IDE, so it makes the transition there easier.

  • Setup the Command Line Compiler if you can. If you love text editors or environments like VS Code, this is a fast and lightweight way to write/test basic code. The syntax will be familiar to Java devs, and you can apparently run scripts though I haven't tried it.

2. IntelliJ IDEA: Setup

Use JetBrains Toolbox Approach

I'd previously installed Android Studio and IntelliJ IDEA manually. Now, I simply uninstalled those versions and reinstalled them via Toolbox App. The ability to manage multiple IDEs and releases from one dashboard, is priceless! Use the Toolbox App to install IDEA and Android Studio IDEs

Install the EduTools Plugin

The EduTools Plugin allows us to explore learning guides (e.g., Kotlin Koans) directly from the IDE - which also has the benefit of giving you more familiarity with IDE features and tooling, as you practice. Don't forget to restart the IDE after installing the plugin!

2. Kotlin CLI: Setup

Install the Command Line Compiler

You have two options:

  • 1. Reuse from IDEA: If you had previously installed IntelliJ IDEA, the compiler is already installed in your development environment. You just need to update your PATH to make it accessible from external terminals. Read more in this StackOverflow response. Note: If you installed the IDE using the Toolbox App, the location is different. Look for: /Users/<username>/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/203.5981.155/IntelliJ IDEA CE.app/Contents/plugins/Kotlin/kotlinc/bin where <username> is your Mac login.

  • 2. Install from scratch: Follow this tutorial. On Mac, I used the Homebrew install since it makes it easier to manage updates later with brew upgrade kotlin. This also takes care of installing the openjdk dependency by default - if you want to use that JDK installation as your default, the install process also provides a PATH update recommendation.

Configure Visual Studio Code to use the CLI

You can also now use it with a text editor or IDE - including my favorite: VS Code. VS Code has community-built extensions to support Kotlin CLI usage - but you won't get the rich tooling of IntelliJ IDEA. Instead, you get a lightweight way to do quick code fixes, command-line builds and deploys, while staying within your familiar IDE.

I followed the approach recommended here to setup my VS Code:

Now, open your Kotlin text file (e.g., test.kt) in VS Code. The Kotlin Language extension activates syntax highlighting and code snippets.

You now have two options to build and run your code:

  1. Open the VS Code terminal and use kotlinc directly.
  2. Use shortcut Ctrl+Alt+N or F1 => Run Code to activate CodeRunner to do this for you.

Validate CLI usage with a simple program

Revisit the CLI tutorial and run your first program. Check out my "First App" post for more details.