0

I have encounter this error anyone got suggestion to solving this? I have tried deleting the cache appdata but it does not work.

Error: Could not find or load main class C:\Users\name\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:111: The following error occurred while executing this line: C:\Users\kailu\AppData\Local\NetBeans\Cache\11.1\executor-snippets\run.xml:94: Java returned: 1

  • 1
    Does this answer your question? [What does "Could not find or load main class" mean?](https://stackoverflow.com/questions/18093928/what-does-could-not-find-or-load-main-class-mean) – FLonLon Oct 14 '20 at 13:54

2 Answers2

0

In NetBeans right-click on your class -> properties -> Run. Then find "Main Class" click "Browse..." and select your existing main class.

0

Try deleting the cache folder

  1. Go to C:\Users\name\AppData\Local\NetBeans\
  2. Delete the Cache folder.
  3. Rebuild and Run

If it does not work, try these steps:

  1. Right-click on the project in the left toolbar.
  2. properties.
  3. Click on Run
  4. Click the browse button on the right side.(select your main class)
  5. Click ok
Omar Atef
  • 5
  • 3
  • Hi i have tried your first option while trying to build, i have this error message "javac: file not found: C:\Users\User\OneDrive\??\NetBeansProjects\Testing\src\testing\Testing.java" – Kaykaykay99 Oct 15 '20 at 16:53
  • Try setting your java path to Environment variables: open computer properties- Advanced system settings- Environment Variables - find the system variables option -Click on the "path" variable - _other variables here_ ; C:\Program Files\Java\jre1.8.0_121\lib\amd64\jvm.cfg; C:\Program Files\Java\jdk1.8.0_121; Then click ok and restart your computer – Omar Atef Oct 17 '20 at 18:54