简体   繁体   中英

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?

在此处输入图片说明

在此处输入图片说明

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM