No main manifest attribute, in tempCodeRunnerFile.jar

Viewed 513

I'm trying to run a simple Kotlin code in Visual Studio Code, using the Code Runner extension. The code doesn't execute, though, and I get the following error:

fun main(args: Array<String>) {
   println("Hello, World!")
}

[Running] cd "c:\Users\Andrei\Desktop\" && kotlinc tempCodeRunnerFile.kt -include-runtime -d tempCodeRunnerFile.jar && java -jar tempCodeRunnerFile.jar no main manifest attribute, in tempCodeRunnerFile.jar

I'm new to Kotlin (Java) and I couldn't find a solution to this. Is there some setup that I need to do before being able to run Kotlin code locally? (I'm using Kotlin version 1.3.40-release-123 (JRE 12.0.1+12))

1 Answers
Related