Reputation: 15716
I create Kotlin/Gradle project like this:
Then I create src.main.kotlin.Main.kt
class with main
method
But I cant' run it. No found menu Run in context menu
Upvotes: 0
Views: 127
Reputation: 15716
Another approach
fun main() {
println("Hello World!")
}
Remove class Main
in the top of file Main.kt
Upvotes: 0
Reputation: 1546
It should be like this:
class Main{
companion object {
@JvmStatic
fun main(args: Array<String>) {
}
}
}
Upvotes: 1