Liondancer
Liondancer

Reputation: 16469

Running java program, maven project on intellij

I feel as though I am missing a very simple step or misunderstood something. I cant seem to run (on intellij) my java program that I wrote in my maven project.

I wrote some code and added some dependencies. The code has no errors. I want to test this code but I cannot because the "play" button to run the program is grayed out. Also when I right click my file to try and find run program, it does not appear!

I think the problem might be because my code states that my main() is never used. Not really sure why it isnt being used. I thought the compiler always looks for a main() to compile/run

public static void main() {
    ...
    ...
}

Not sure how I can test this program. Can someone help me with my problem?

enter image description here

enter image description here

Upvotes: 0

Views: 174

Answers (1)

JamesB
JamesB

Reputation: 7894

The signature of the main method is

public static void main(String[] args)

Edit your main method to this signature and try again.

http://docs.oracle.com/javase/tutorial/getStarted/application/

Upvotes: 2

Related Questions