Kotlin/Native with CLion
Last Updated | 23 January 2018 |
In this tutorial we'll see how to
Configuring CLion for Kotlin/Native development
While it is certainly possible to use any editor to write Kotlin/Native code, JetBrains provides a fully-fledged IDE experience for Kotlin/Native via CLion. CLion is a C/C++ IDE built on the IntelliJ platform.
Kotlin support in CLion is provided via a couple of plugins, namely the Kotlin plugin which provides core support for the language, and the Kotlin/Native plugin which
adds functionality for native support. Both of these plugins are provided by JetBrains and can be installed using the the Plugins
configuration dialog
Once installed (which requires a restart of the IDE), we should now have Kotlin support enabled. We can now create a new project using the
New Project
wizard
Additionally we can also create a new project based on an exiting sample template, by choosing one of the available ones
In our case we're going to use the Hello World
template to generate a sample application.
Building an running the application
Once we have created the application, we can build and run it by using the Run
menu and selecting Build
, or alternatively
pressing the assigned keyboard shortcut (which depends on our keyboard mapping)
To run the application, we merely select Run
from the same Build
menu and see the output