JetBrains / kotlin-playground

Self-contained component to embed in websites for running Kotlin code
https://jetbrains.github.io/kotlin-playground/examples/
Apache License 2.0
447 stars 80 forks source link

No main method found in project. #177

Closed Louie-Jay closed 11 months ago

Louie-Jay commented 1 year ago

The code is: fun main() { println("1") println("2") println("3") }

yet it says "No main method found in project."

https://pl.kotl.in/DWXmp7tnK

nikpachoo commented 1 year ago

Hi, @Louie-Jay! For Kotlin 1.2 version you should specify the argument like this:

fun main(args: Array<String>) {
    println("1")
    println("2")
    println("3")
}