Kotlin Environment setup with Intellij IDEA

Kotlin is a statically typed, general-purpose programming language developed by JetBrains that has built world-class IDEs like IntelliJ IDEA, PhpStorm, Appcode, etc. It was first introduced by JetBrains in 2011. Kotlin is object-oriented language and a better language than Java, but still be fully interoperable with Java code.

Let’s see how to setup Environment for Kotlin using Intellij IDEA and run our first Kotlin code.

  1. To get started, install a recent version of IntelliJ IDEA. You can download the free Community Edition from JetBrains.
  2. Once you have installed the Intellij IDEA, create a Kotlin application.
    Creating a new project from File -> New -> Project.Then select Kotlin -> JVM | IDEA .

  3. Name your project and select the SDK version for it. Here we name the project HelloGeeks!.

  4. Now you have new project HelloGeeks!. Create a new Kotlin file under the source(src) folder and let’s name it is firstapp.kt

  5. Once the file is created, write the main function. IntelliJ IDEA offers a template to do this in a faster way. Just type main and press tab. Add a line of code to print out ‘Hello Geeks!’.

  6. Running the application.Now the application is ready to run. The easiest way is to click the green Run button in the sidebar and select Run ‘FirstappKt’. You can run directly by pressing Ctrl + Shift + F10.

  7. If your program compiles successfully you will see the output in the Run Tool Window.



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.