Function main not found in class Main

I'm unable to get beyond this error message trying to make the simplest hello world program work with Kotlin and Gradle on Intellij 14.1.1 and Kotlin I'm using JDK on OSX 10.10.2. Attached screenshots show the code, gradle config and run config.

[Screen Shot 2015-04-13 at 10.25.13 PM.png|attachment](upload://xA6FknGFz73PE8QdcDiY0WhCxaa.png) (48.9 KB)

[Screen Shot 2015-04-13 at 10.22.17 PM.png|attachment](upload://hRr2ji9hTMEEKlsr7Z3s6Lx3JQ1.png) (20 KB)

[Screen Shot 2015-04-13 at 10.22.40 PM.png|attachment](upload://wyzU7D5xwifH8mKyiBOL18CR9wY.png) (57.6 KB)
1 Like

Change you class for an object and add platformStatic to your main method

object Main {   platformStatic fun main(args: Array<String>){   println("Hello kotlin")   } }

or put your main function outside the class

fun main(args: Array<String>){   println("Hello kotlin") }

1 Like

Thanks Mario that was the trick!