Skip to content
← Back to Community
How do I fix a "Could not find or load main class Main" error?
Profile icon
blakejoseph

Keep getting the same errors even if I change the file name to Main.Java or the name of the public class, not sure what to do.

help

Voters
Profile icon
blakejoseph
Comments
hotnewtop
Profile icon
Coder100

class names must match file names. So on line 1, change it to:

public class Main
Profile icon
InvisibleOne

I'm pretty sure you need to have a main method.