I've just created an empty project in IntelliJ Ult...
# intellij
v
I've just created an empty project in IntelliJ Ultimate 2020.1, using Gradle and Kotlin build script. But IntelliJ isn't recognising my main method - no green arrow. Nor can it find it from "Add Configuration..."
Copy code
class Launcher {

    fun main(args: Array<String>) {
        println("Hello world")
    }
}
IntelliJ didn't tab-complete either when creating
main
- I had to write it all out by hand.
m
try to write
psvm
somewhere in the file outside of the class
intellij should suggest you a quick action, tap enter and it’ll generate the main function
v
So psvm can't happen inside a Kotlin class?
seems like @JvmStatic annotation should also work
v
I've been writing in Kotlin for a couple of years and completely forgot... been a while since I started a new project, clearly!
d
You could also place it in a companion object.