Recently I experienced two such annoyances and each took me quite a while to figure out, so here I jot them down.
Case#1: Crashed Eclipse metadata. This can happen after unexpected power outage or other ungraceful Eclipse closure.
- Symptom: Eclipse can’t find project or main class
- Solution: Find out the current workpace (Preference->search for Workspace), shutdown Eclipse, delete the .metadata directory under the workspace directory, start Eclipse, create the project and run it again
Case#2: Wrong VM options (VM arguments).
- Symptom: error message in console tab like “Error: Could not find or load main class Files.Liuzy163.HelloWorld.lib”
- Cause: I put a -DlibDir=c:\Program Files\Liuzy163\HelloWorld\lib as a VM argument.
- Solution: double quote the arguments including spaces.