No Main class found in NetBeans

  1. Right click on your Project in the project explorer
  2. Click on properties
  3. Click on Run
  4. Make sure your Main Class is the one you want to be the entry point. (Make sure to use the fully qualified name i.e. mypackage.MyClass)
  5. Click OK.
  6. Run Project 🙂

If you just want to run the file, right click on the class from the package explorer, and click Run File, or (Alt + RF), or (Shift + F6)

Leave a Comment