IntelliJIDEA Unable to run program
已回答
Hello, I'm using Intellij2017.1.2 (Ultimate) running on MacOSX (Capitan) and I'm currently unable to run my program. I've read this article: https://stackoverflow.com/questions/30923909/unable-to-run-java-code-with-intellij-idea and have ensured that my program is in the src folder (it was originally in the src folder - no copy or move necessary). I'm able to build (Build > Build Project) no problems, but the Run option is grayed out. Any help would be much appreciated as I've done a good bit of research online already. Attached is a screenshot of the first bit of my code. Many thanks, Jon
请先登录再写评论。
You need to create Run/Debug Configuration first (or select it if there is already one exists). IDE can create it automatically for the main method. But you need to change it to public static void main (you do not have static modifier).
(forehead slap). I needed the static modifier. Thanks muchly!