Reputation: 131
Why can't I run particular classes in Intellij? For instance, I have following classes in the same project, but I can't run all of them. How to fix that?
Upvotes: 0
Views: 792
Reputation: 3557
These classes have methods with the signature public static void main(String[])
, the entry point for a Java program. Classes that don't have a method with this signature will (with some exceptions, i.e. JavaFX' Application
) not be shown as runnable by IntelliJ.
Upvotes: 2
Reputation: 12819
According to the documentation it denotes a:
Java class that contains declaration of the main() method.
If you want to run the program you will need to add a main()
Upvotes: 2