The class which you're trying to execute doesn't have a main
method.
Since your main
method looks syntactically fine, this can have two causes:
- You're executing the wrong class.
- The actual class file doesn't contain this code.
The solution is obvious:
- Make sure that your command is pointing the correct class file, you might have multiple class files with the same name and be sitting in the wrong directory.
- Make sure that you've compiled the correct source file into the correct class file before, you might have edited one and other and forgot to recompile.