eclipse compilation problem

Problem description : The same maven project, nothing modified, opened with the latest eclipse, eclipse did not compile the java file

 

I have found a lot of methods, as follows:

The first may be that your automatic compilation is not turned on: project->build automatically;

The second thing is to pay attention to whether there is a red cross on your project. When the project reports an error, eclipse will not compile it automatically. You can check whether some classes are wrong, or check whether the "build path" is complete, especially when debugging the program from the switch, some paths for importing the jar package are wrong.

    Usually we encounter the second one, that is, some packages exist on other machines, but the same path to your machine does not exist, delete the package related to that package, or add a new package path

    Eclipse does not compile the project phenomenon. How to refresh the classes directory is also empty.

    The details are all done: open project->build automatically and try it, but it still doesn't compile.

    Open the project --> build automatically and it may compile after another clean, but the result is not enough. (Generally run project --> clean..., and then execute build automatically)

    Eclipse defaults to automatic compilation. Even if automatic compilation is canceled and the project is manually built, it cannot be compiled.

    This usually occurs for the following reasons:

    1. If an unused jar package is imported into the project, and that package is deleted by you, there will be a situation where no error is reported but no class document can be compiled. You can delete any package, and then one by one Re-introduce (required), do not introduce any package at once, useless may cause adverse consequences.

    2. I want to delete a class document and regenerate it. After deleting the class document, the folder in the classes directory is opened by other programs, such as Total Commander. At this time, the compilation will not pass, and it may prompt "con'" under problems t delete classes...". Close other programs and recompile.

    3. In another case, remove the JRE System Library and re-import it to compile. But what causes it is unclear.

    4. The project references other projects, and the project you are referencing references an unused jar package or the like.

 

    I have tried all the above questions, but it still doesn't work. Finally, I found one: close project, delete project (do not delete the file), enter the system file, delete .classpath and .project, because it is a maven project, import maven Project and let eclipse automatically generate it .classpath and .project files, everything is ok. . .

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326563563&siteId=291194637
Recommended