How do I run a Kotlin file within the Intellij? Sa...
# intellij
s
How do I run a Kotlin file within the Intellij? Say I have Somefile.kt which has a code like below.
Copy code
fun main() {
    println("hello")
}
I can run it in a terminal using
kotlinc Somefile.kt -include-runtime -d output.jar
and
java -jar output.jar
. But how do I create the configuration to run it within Intellij.
m
Weird, intelliJ usually shows me a small green "run" triangle in the gutter.
Maybe try adding args ?
fun main(args: Array<String)
or maybe rename Somefile.kt to Main.kt ? or apply the application plugin ?
s
It does show me the run triangle if I come out of the power saving mode. I am using power saving mode to emulate white board interview kinda scenario.
It turns out there is a right-click option or shortcut to run the files
Ctrl+Shift+F10
to run the code.