Some time eclipse not run any java file and give exception like
"Error: Could not find or load main class"
Bellow are few solution :
Solution 1 )
"Error: Could not find or load main class"
Bellow are few solution :
Solution 1 )
- went to run configurations: - run->run configurations
- Select Advanced
- Add where Eclipse usually put the *.class for the projects, which is in bin. So I added the bin directory for the project.
Solution 2)
Project -> Clean
will remove any existing class files and completely rebuild the project.
Solution 3)
It seems that the class is not compiled by Eclipse.
Few pointers could be-
Few pointers could be-
- Check if the .class file exists in your output folder.To know your output folder Right Click on Project->Properties->Java Build Path(Check at bottom).
- Check if Project->build Automatically is checked in the menu.
- Check if the HelloWorld class is in src folder or not.Right Click on Project->Properties->Java Build Path(Check source tab).
No comments:
Post a Comment