Reputation: 209
Since yesterday, Eclipse is not updating the .class
files of my project. For example the filename.java
is up to date, but the filename.class
file has a modified date of yesterday. It used to work just fine. Why is this happening?
Upvotes: 8
Views: 34613
Reputation: 2447
This can happen if you add then remove maven
support to a project.
Eclipse will still be placing the compiled files into target/classes
& not into bin
(which you were synchronizing with your webapps
folder).
To fix this go into Project Properties & change:
=>
Source =>
Output folderUpvotes: 0
Reputation: 641
I had this problem (on Eclipse Neon). I had to check the JRE System Library before it would update the classes in the target folder:
Hope this help.
Upvotes: 0
Reputation: 1323
I have faced same problem. And the solution is the Project Java version and JRE System Library.
Follow the bellow steps:
Upvotes: 1
Reputation: 5353
Another thing to consider, open the marker windows. If you have a Java Build Path problem, Eclipse won't update them until you resolve them.
Upvotes: 0
Reputation: 415
Delete the build folder of your project, then clean the project (make sure you have the Build Automatically option enabled)
Upvotes: 0
Reputation: 834
Make sure Java builder is active in the
Project -> Properties -> Builders
menu
Thanks to @ege-akpinar, I found out that for some reason the Java builder
in my project settings had gone missing. Unfortunately you can't simply add the builder again. To fix this you'll have to edit the .project
file in your projects root folder. Make sure the following lines are present in the file:
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
To make the change I closed Eclipse. Afterwards I checked the Builders
preference, cleaned and built the project again. The change made it work again.
Upvotes: 4
Reputation: 26
Perhaps you have old class files around? When I added my project to Git, it seems the target directories were different. I found duplicate class files in two separate folders - one set was old. Yet, the old set seemed to be the "goto" set for Tomcat. I discovered and resolved the problem by searching for *.class on the root project folder and deleting all results. Once I rebuilt the project - it worked perfectly. (It also fixed my Export to War deployment which also seemed to have been picking up the old class files.)
Upvotes: 0
Reputation: 661
The steps I followed when I faced this problem were:
Project > Clean
the project.Project > Build Automatically
is turned on.Upvotes: 5
Reputation: 3286
I would suggest doing the following
Project -> Properties -> Builders
menu.class
files manually via File Explorer and give it another try.Upvotes: 11
Reputation: 1
I had a similar problem when the installed JRE and the compiler versions did not match.
It worked when I selected the same version of the JRE as the compiler.
Upvotes: 0
Reputation: 1101
Few things I would do or double check:
Upvotes: 22