Hello, IntelliJ doesn't allow me to run `fun main(...
# getting-started
m
Hello, IntelliJ doesn't allow me to run
fun main() {}
without the args array (works with it), why is that?
s
how old is your Kotlin plugin?
m
1.3.41-release-IJ2018.2-1
s
that looks more than recent enough lol
Oh, do you have the correct language version set in your Project Structure?
m
I only see a setting for Java version, not Kotlin version.
s
If you click on Modules in the sidebar, you’ll see a project tree
under wherever your main package lives, you should see a Kotlin entry in the tree
should look something like this
m
Looks like this to me
s
Hm, it kinda looks like Kotlin isn’t set up for your project 😕
did you use like a gradle starter or something like that?
m
But it definitely works, so how is that possible 🤔
s
Honestly have no idea
if you’re using gradle, maybe try reimporting the project
if not, I suppose you could hit the + button and add the Kotlin module manually
m
Oh I added a Kotlin module to that tree and switches the language version there, now it works! Thank you.
👍 1