Wednesday 23 November 2016

Error: Could not find or load main class


Solutions :


Same Problem occur with me once below are the steps i follow.


Solution 1 :

  • I went to project > properties > javaBuildPath.
  • There In order of export , I moved up my java/main to the top priority.


Solution 2 :


  • Go to run configurations: - run->run configurations
  • In the Classpath tab: 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 3 :

  • Project -> Clean
  • Make sure Project -> Build automatically is active
  • Project -> Properties -> Java Build Path -> Libraries: Remove any external libs you have ever added. Don't remove standard libraries like the JRE System Library.
  • Try to run your main class now. The "class could not be found / load" error should be gone. Try adding your external libs/jars one after each other.




No comments:

Post a Comment

Spring boot with CORS

CORS (Cross-Origin Resource Sharing) errors occur when a web application running in a browser requests a resource from a different domain or...