Learn Pain Less

HomeOur TeamContact
Kotlin
Getting Started with IntelliJ IDEA for Kotlin
Pawneshwer Gupta
Pawneshwer Gupta
June 30, 2017
1 min

Table Of Contents

01
Getting Started with IntelliJ IDEA for Kotlin
02
Setting environment
03
Create a replacement project
04
Application running
Getting Started with IntelliJ IDEA for Kotlin

Getting Started with IntelliJ IDEA for Kotlin

This tutorial walks you through creating an easy Hello World application using IntelliJ IDEA.

Setting environment

In this tutorial, we have to use IntelliJ IDEA. To get started, install the most recent version of IntelliJ IDEA.

Kotlin is bundled with version 15 with the IntelliJ IDEA.

You can download the free community version (or the full-final version) from the JetBrains website.

As an alternative to using IntelliJ IDEA, you will compile and execute Kotlin applications using the instruction compiler. For details, see Working with the instruction compiler.

If you are new to JVM and Java, observe the JVM Minimal Survival Guide. If you are the new IntelliJ IDEA, then observe the IntelliJ IDEA Minimum Survival Guide.

Create a replacement project

Once you have the IntelliJ IDEA installed, it is time to build your first Kotlin application.

  1. Create a replacement project from a File -> New -> Select Kotlin | JVM | IDEA Project Type.

Kotlin New Project
Kotlin New Project

  1. Give your project a name and choose an SDK version for it.

Kotlin Project Name
Kotlin Project Name

Now you have a new project created with the following folder structure:

Kotlin Folder Structure
Kotlin Folder Structure

  1. Create a new Kotlin file under the source folder. It can be named anything. Let’s call it the app.

Kotlin New File
Kotlin New File

  1. Once the file is created, add the main function that is the entry point of the Kotlin application. IntelliJ IDEA provides a template to do this quickly. Just type main and press tab.

Kotlin Main Fun
Kotlin Main Fun

  1. ‘Hello World!’ Add a line of code to print.

Kotlin Hello World
Kotlin Hello World

Application running

Now the application is ready to run. The easiest way is to click on the green run icon in the gutter and choose the run ‘app.kt’.

Kotlin Run App
Kotlin Run App

If all goes well, you will see the result in the tool window.

Kotlin Run Output
Kotlin Run Output

congratulation! Now you have your first Kotlin application running.

Subscribe to our newsletter!

We'll send you the best of our blog just once a month. We promise.

Tags

startIntelliJIDE

Share


Pawneshwer Gupta

Pawneshwer Gupta

Software Developer

Pawneshwer Gupta works as a software engineer who is enthusiastic in creating efficient and innovative software solutions.

Expertise

Python
Flutter
Laravel
NodeJS

Social Media

Related Posts

Basic Syntax of Kotlin Programming Language
Basic Syntax of Kotlin Programming Language
June 30, 2017
1 min
Working with Files, Folders java
Java
Working with Files, Folders java
March 25, 2015
1 min
Learn Pain Less  © 2024, All Rights Reserved.
Crafted with by Prolong Services

Quick Links

Advertise with usAbout UsContact Us

Social Media