Make sure the project source folder (src) is on the build path. If not, the main () method may not be included in your project. You can follow these steps to check your source path settings:
- Right click on your project with
Package Explorer . - Select
Properties (ALT + Enter) - Go to the
Java Build Path Click tab on the Source tab and check if the source folder is on the build path.
Once verification is complete, you can close your project and reopen it. Then you can right-click the class file using the main method ( ServerMain.java in your case ) and run it.
source share