Function main not found in class Main


#1

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 0.11.91.1. I'm using JDK 1.8.0.20 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 (48.9 KB)

Screen Shot 2015-04-13 at 10.22.17 PM.png (20 KB)

Screen Shot 2015-04-13 at 10.22.40 PM.png (57.6 KB)

#2

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") }


#3

Thanks Mario that was the trick!