Configure Kotlin to an existing project in IntelliJ

Viewed 12013

I created a kotlin new Kotlin project through intelliJ (https://github.com/dhananjay12/kotlin/tree/master/kotlin-basic) a while back. I then imported it into IntelliJ from a different machine.

There is no run option coming : enter image description here

I tried to configure using Project SDK and Libraries, still, IntelliJ doesn't recognize it as a kotlin project. enter image description here

enter image description here

NOTE- New project works completely fine

How do I configure an existing project to Kotlin?

What files need to be saved in git so that manually configuring IDE is not required?

1 Answers

1) Right click the src folder

2) Mark directory as Sources Root

3) Will ask you to configure Java SDK and Kotlin Plugin for the module. Do it.

4) Run & enjoy

Related