Eclipse cannot automatically compile java files and will not generate CLASS

 Every time I modify the class code, I have to restart Tomcat. It took 1 day to finally solve the problem. The Internet basically said the following methods 1 and 2. After using it, it still doesn't work. Finally, I rebuilt the working environment and imported the project to compare and find the third method.

    1. There is a "Build Automatically" under Project, and it will be automatically compiled after it is checked.

 

    2. If it still doesn't compile, look at the prompts under the "Problems" (in Windeow > Show View > Other, as shown below) tab to see if there is an error in the project (for example: missing jar, wrong compilation path, etc. ), resulting in no way to compile, follow the prompts to solve the problem, and it can be automatically compiled.

 

    3. If it still doesn't compile, it may be a problem with Eclipse settings, causing the project's plug-in to be lost. Open the .project file under the project to see if there is the following content under buildSpec

copy code
1 <!-- autocompile -->
 2 <buildCommand>
 3     <name>org.eclipse.jdt.core.javabuilder</name>
 4     <arguments>
 5     </arguments>
 6 </buildCommand>
 7
 8 <!-- auto-authentication-->
 9 <buildCommand>
10     <name>org.eclipse.wst.validation.validationbuilder</name>
11     <arguments>
12     </arguments>
13 </buildCommand>
copy code

 

 At present, after these three situations have been dealt with, there is no one that cannot be automatically compiled. If it still does not work, you can only rebuild the workspace and import the project.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325894786&siteId=291194637