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 :
I tried to configure using Project SDK and Libraries, still, IntelliJ doesn't recognize it as a kotlin project.
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?
To convert Java code to Kotlin, open the Java file in Android Studio, and select Code > Convert Java File to Kotlin File. Alternatively, create a new Kotlin file (File > New > Kotlin File/Class), and then paste your Java code into that file.
Go to Intellij Preferences -> Build, Execution, Deployment -> Kotlin Compiler. Update Language version and Api version to the one you wish.
The plugin is bundled with IntelliJ IDEA and is activated by default. If the plugin is not activated, enable it on the Plugins page of the IDE settings Ctrl+Alt+S as described in Install plugins. IntelliJ IDEA provides first-class support for Kotlin.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With