Have Googled extensively on this error, but I can't seem to fix the problem. I've written a basic java program in Eclipse Juno, as follows:
public class HelloWorld { /** * @param args */ public static void main(String[] args) { System.out.println("Hello Eclipse!"); } }
After clicking Run, I get: "Error: Could not find or load main class HelloWorld". This error message applies to all my other projects in the same workspace. I've tried switching workspaces but the error still appears.
I'm on Windows 7 64-bit. Any help would be appreciated!
When you get the message "Could not find or load main class ...", that means that the first step has failed. The java command was not able to find the class. And indeed, the "..." in the message will be the fully qualified class name that java is looking for.
This just happened to me today after updating my JRE. I cleaned the project and it started working again.
Project -> Clean
will remove any existing class files and completely rebuild the project. There's more information on Eclipse's clean function here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With