Open In App

Kotlin Environment setup with Intellij IDEA

Last Updated : 09 May, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

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.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads