Installing Kotlin Native
We can install Kotlin Native from the source, or grab the binaries from the web. Feel free to go with any method you prefer; the end result will be the same.
Installing from the source
In order to install Kotlin Native on our machine, we need to compile it from the source. Follow these steps to download the source and compile it:
- Clone the Kotlin Native compiler source using the following command:
git clone https://github.com/JetBrains/kotlin-native.git
- Let's switch to the cloned directory using
cd kotlin-native
. - Download the dependencies using
./gradlew dependencies:update
. - Then build the compiler and libraries. We should use
./gradlew bundle
, but it can take a few hours to build. Therefore, we will build only with the host compiler and the libraries using./gradlew dist distPlatformLibs
, which should build pretty quickly. - Add the Kotlin compiler to the environment variables (the steps to add it vary). The following command should ideally work on most systems:
export...