Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't Eclipse updating the classes?

Tags:

java

eclipse

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?

like image 269
menemenemu Avatar asked Mar 05 '12 20:03

menemenemu


People also ask

How do I get .class in eclipse?

To get there, we go to the menu under Navigate > Open Type in Hierarchy or we use the shortcut: Ctrl + Shift + H on a PC or Cmd + Shift + H on a Mac. This dialog is similar to the Open Type dialog. Except for this time when we click on a class, then we get the Type Hierarchy view.

How do I compile a .Java file into a .class file in eclipse?

Step 1: Open Eclipse and click File > New > Java Project. Step 2: Provide the Project Name and click on the Finish button. Step 3: In the Package Explorer (left-hand side of the window) select the project which you have created. Step 4: Right-click on the src folder, select New > Class from the submenu.

How do you update references in eclipse?

Eclipse makes this absurdly easy to do. Right-click on almost anything and choose Refactor > Rename. Type in a new name for whatever it is, and make sure that the Update References checkbox is checked. This will ensure that all references in all of your code will be updated.

How do I add a class to a project in Eclipse?

Creating New Classes. Now that you have a project set up, you're going to want start writing some new classes. The easiest way to do this is to right-click on a project in the Package Explorer and select New > Class.


2 Answers

Few things I would do or double check:

  1. Project > Clean on the project you're working on.
  2. Project > Build Automatically - turned on so the code rebuilds in your workspace on saved changes.
  3. Window > Preferences and make sure your Installed JRE's and Compilers are matching Java versions
like image 92
derdc Avatar answered Sep 27 '22 20:09

derdc


I would suggest doing the following

  1. Make sure Java builder is active in the Project -> Properties -> Builders menu
  2. Clean the project and re-build it.
  3. If that doesn't work, remove the .class files manually via File Explorer and give it another try.
like image 23
Ege Akpinar Avatar answered Sep 27 '22 21:09

Ege Akpinar