coder
coder

Reputation: 41

I can't run the program in intelliJ

enter image description here

I created a project unchecked (Create project form template) and added new class named demo. but when after compiling, I couldn't run the code intellij didin't show me result. "Edit configuration" only appeared like this:

enter image description here

I don't know what to do :( I saw someone run the code using Intellij without writing package. So I don't think that it doesn't work because I didn't write package. What can I do?

Upvotes: 2

Views: 5948

Answers (2)

Mohamed
Mohamed

Reputation: 864

Add the args parameter to the main method. Then right click into the editor -> and select "Run demo.main()"

Upvotes: 0

folkol
folkol

Reputation: 4883

You are missing the String[] args parameter in your main method:

public static void main(String[] args) {

}

Upvotes: 5

Related Questions