Search code examples
intellij-ideakotlindevelopment-environmentkotlin-native

What is the recommended IntelliJ setup for Kotlin Multiplatform


I've been trying to get an environment for working with Kotlin (multiplatform) for a little too long now and would like some advice. I seem to get stuck on which version of JDK do I need, should I download Android Studio for the Android SDK or is there a cleaner way than getting the full IDE, which version of IntelliJ to use and which version of the Kotlin plugin is compatible.

I would like to use Kotlin 1.3.

My aim is to develop a common library with no platform-specific code; though I would like to test it on Android, Linux, WebAssembly.

Lubuntu 18.04.1 Intel x64


Solution

  • You should target Java 6 code if you're planning to use the library in Android and not having any headaches. Note that you need to specify that explicitly to the Kotlin compiler. Only setting the IntelliJ IDEA project to target Java 6 won't do.

    The JDK version doesn't really matter since you can tell the compiler to generate code for any previous Java version.

    IntelliJ IDEA is probably the best IDE for Kotlin since it's made by JetBrains, the same guys that are behind Kotlin itself. Get the latest version.

    You don't need any extra plugin, Kotlin is supported out of the box by IntelliJ IDEA (i.e. Kotlin plugin is included in the standard version).