IntelliJ IDEA is java integrated development environment for developing computer software. It is developed by JetBrains. It is available as an Apache 2 Licensed community edition, and in a proprietary commercial edition. Both can be used for commercial development.
Note: This is next part in the Kotlin Tutorial series. You can visit Previous tutorial to know more.
In this tutorial, you will learn how to create kotlin project in IntelliJ IDEA.
At this point, i am assuming that you have successfully installed IntelliJ IDEA. If not, you can download and install IntelliJ IDEA from Download IntelliJ IDEA. Kotlin is bundled with IntelliJ IDEA starting from version 15.
Now, we will go through step by step and see how you can create a new project.
Follow steps below to create a new project –
1. if you are at Welcome to IntelliJ IDEA screen, select Create New Project.
2. Select Java Module and Select the SDK. You need JDK 1.6+ to work with Kotlin. So, Select at-least 1.6 version. In the Additional Libraries and Frameworks fields, select Kotlin(Java) option. After entering all details, click Next.
3. In the next screen, Provide project name and select project location where you want to store the project. Then, click Finish.
4. After this, a project will be create. Folder structures of the newly created project will be as below.
5. As you have noticed, there is no kotlin file created yet. So, you need to create a new kotlin file and write you first kotlin program to print Hello World. So, create a new kotlin file. Select HelloWorld(Project Root file) => src folder and right click on it. Now, go to New => Kotlin File/Class to create a new File. We will name this file app.kt. However, you can name it as per your choice. Below image clearly depicts the process.
6. We have successfully create a new kotlin file. Now, our job is to write main routine which is entry point for any kotliin application. IntelliJ IDEA offers a template for this process. Type main and press tab. You will see that a method is created in kotlin file.
7. Now, write the code to print Hello World.
That’s it. Run the application and you will see the output as shown below.
If you have any suggestion about this post, please comment below. We are looking for someone who helps use to make our tutorial better. Also, If you want tutorials on any topic, you can mail us at email@example.com. We will try to cover the topic as soon as possible. Connect with us on Facebook, Google+, Twitter and Youtube for more updates.