title: Netbeans Error: Could not find or load main class (again)
body: <p>I am very experienced in Java, but not in Netbeans. I have a project that I've been working on, a little test program for a particular issue, so I have been making changes to it and running it and debugging it many times a day, every day, for several weeks. Yesterday Netbeans quit running it the way I had been running it, and I can't seem to get it started again.</p>
  
  <p>The entire output when I run the project is:</p>
  
  <pre><code>run: Error: Could not find or load main class 
  
  C:\Users\rcook\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:53: Java returned: 1 
  BUILD FAILED (total time: 0 seconds)
  </code></pre>
  
  <p>I note for whatever it's worth that the classname does not appear on the first line, as it seems to with others who have had the "could not find" error.</p>
  
  <p>This happens whether I run the project (select the project and press F6) or the file (select the file and press control-F6). I have cleaned and rebuilt the project (which I didn't do often before, I've wondered if it <em>caused</em> the problem). I have restarted Netbeans. I have restarted the (Win7) computer. I am not running any memory-hogging programs except for Outlook, which I have been running the entire time it was working.</p>
  
  <p>I can run the program from the command line by setting my default directory down to the 'classes' directory under the project and entering <code>java stsclientexample3.STSClientExample3</code>.</p>
  
  <p>I have checked the "Run" configuration many times -- there are no program or VM options entered, it has the correct classname. Oddly enough, if I change the classname to something that isn't there, Netbeans displays a popup that says the invalid name class wasn't found in the project, and listing the main classes available. But when I do that and select the one to run, it gives the same "could not find" error. There's one other main class in the project, if I select THAT it gives the same "could not find" error.</p>
  
  <p>I have looked at the XML file referenced in the message, but it is full of ${parameter} references that I don't know the resolution of. It would likely be helpful to know how Netbeans resolves "${classname}", for instance, or even to dump the value Netbeans has at runtime somehow.</p>
  
  <p>I have commented out code and re-run. Same result.</p>
  
  <p>I have deleted that class from the run configuration, restarted Netbeans, and added the class back. Same result.</p>
  
  <p>By now I've read more than a dozen other queries for a similar error, on SO and other places; I've tried all the things that looked at all possible (skipping things like configuring for special-purpose libraries, etc.).</p>
  
  <p>Anyone know how to fix this?</p>
  
  <hr>
  
  <p>EDIT: before someone asks, another project with a <code>main()</code> runs using the 'run project' option.</p>
  
  <p>EDIT2: I forgot to mention, also, that another post recommended that one delete the Netbeans cache (c:\Users\\AppData\Local\NetBeans\Cache), so I shut down NetBeans, deleted everything in that directory, and restarted NetBeans. Same result.</p>