IntelliJIDEA Unable to run program

Answered

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

0
2 comments

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).

0
Avatar
Permanently deleted user

(forehead slap). I needed the static modifier. Thanks muchly!

0

Please sign in to leave a comment.