Eclipse could not compile, prompting "error: The main class could not be found or could not be loaded"

Source: Internet
Author: User
Tags svn

jar Package Issues :

1. The source attachment for a jar package in libraries in the Java Build path of the project refers to a jar package that is not available,

The workaround is to remove the unusable jar package.

2. The project's Java Build Path has a jar package that is not available in libraries, showing a red fork. This indicates that the system could not find this jar file.

Workaround: Remove the jar.

3.eclipse:eclipse is turned on, and when you update the SVN code, and then run the Java program in Eclipse, you may also be prompted with "error: the main class could not be found or could not be loaded ...".

The workaround is: Right-click on the Eclipse project folder,-refresh, recompile, and OK.

4. During the project, I updated SVN to update the code on my machine to the latest version, but when I ran the program, I found the eclipse hint: "Error: The main class could not be found or could not be loaded ...". The discovery did not generate a. class file at all, that is, there was no time to compile. Later even the error message is not, click "Build Project" after a little reaction is not, can not compile. Finally found himself made a mistake good low: the SRC folder in the project is not a "source package" form, the display is the normal folder style.

The solution is: on the SRC folder right click-build path-use as Source folder, re-compile, everything is OK.

Eclipse could not compile, prompting "error: The main class could not be found or could not be loaded"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.