In Eclipse, "rebuilding a project" means deleting the IDE's compiled output and derived metadata and then recompiling the source and regenerating those derived artifacts, so the fix you need is usually Project → Clean…, not a single pass of Build; a plain build only compiles files Eclipse believes are out of date. That distinction is the whole answer in miniature: "build" is incremental work against Eclipse's model of what changed, while "clean and rebuild" throws that model away and starts over. Confusion arises because Eclipse uses several overlapping terms—Build, Clean, Rebuild, Refresh—that users and tutorials often interchange, and because the exact menu names shift with Eclipse version and with project type (Java, C/C++, Maven, Gradle, plug-in development).
The core distinction: build versus clean-and-rebuild
Eclipse's incremental builder tracks dependencies and timestamps. It normally rebuilds only files affected by edits, which is fast and usually correct. A full rebuild is the blunt instrument you reach for when that incremental state has gone wrong: stale class files, phantom compile errors after a refactor, resources that no longer copy, or a project that "works on the command line but not in Eclipse."
The standard sequence for a Java project is:
1: Project → Clean…, select the project (or "Clean all projects"), confirm. 2: Let the build finish; check the Problems view and the Console for errors. 3: If output still looks wrong, right-click the project → Refresh (F5), then build again.
"Clean" removes the contents of the project's output folder (by default bin/ for Java projects) and forces a full recompile. "Build Project" (and "Build Automatically," usually on by default) only does incremental work. There is no separately labeled "Rebuild" command in the standard Java perspective; the clean-plus-build combination is the rebuild.
Where the menu items live, and why versions matter
Commands sit in the Project menu and the right-click context menu. "Build Automatically" toggles incremental background builds. "Clean…" opens a dialog with project selection and, in some versions, a checkbox to build immediately after cleaning.
Because menu labels and dialog options vary by Eclipse release and by installed plug-ins, I can't give you a version-exact click path without knowing your Eclipse edition and version—that specific detail is unknown here, and the reference date does not verify any particular release. What is stable is the concept: find Clean under Project, follow it with a build, and inspect the Problems view. If your menus look different, your perspective or project nature differs, which is the next point.
Project type changes what "rebuild" touches
The same word hides different mechanics:
Plain Java project: Clean deletes bin/ (or your configured output folder) and recompiles .java to .class. Maven project (m2e): Eclipse's builder and Maven's own lifecycle can disagree. The reliable rebuild is often right-click → Run As → Maven clean, then Maven install or Maven compile, or mvn clean install from a terminal, followed by Maven → Update Project (Alt+F5) so Eclipse re-reads the POM. Cleaning only the Eclipse builder may leave target/ untouched. Gradle project (Buildship): use Gradle → Refresh Gradle Project and run clean build from the Gradle tasks view or terminal; the Eclipse builder alone may not regenerate everything Gradle owns. C/C++ (CDT): Clean removes object files under the build configuration folder, then Build recompiles; makefile-driven vs. managed builds behave differently. Plug-in/RCP development: a clean may need to target the workspace plus the target platform, and stale plug-in state sometimes requires launching a fresh runtime workspace.
The pattern: identify which system owns the derived files. Cleaning one system while another holds stale output is the most common reason "I cleaned and it's still broken."
Why a rebuild fixes some problems and not others
A rebuild repairs derived-state problems: deleted or corrupted class files, an output folder excluded or filtered incorrectly, resources not copied, or a dependency graph Eclipse mis-tracked after moves and renames. It does not fix problems whose cause lives in configuration or source: a missing JAR on the build path, a compiler compliance level set to the wrong Java version, duplicate classes from two libraries, encoding mismatches producing garbled characters, or a genuine syntax error. If a rebuild changes nothing, the defect is upstream of compilation.
A useful counterexample: suppose Foo.java compiles cleanly but Foo.class is stale because a rename confused the incremental builder. Clean-and-build fixes it. Now suppose a library was removed from the build path; every rebuild fails identically, because the source genuinely cannot resolve a type. Rebuild is a reset, not a repair.
Reading the result: Problems, Console, and the Error Log
After a rebuild, the Problems view lists errors and warnings with file and line; the Console shows output from Maven, Gradle, or Ant if those ran; and Window → Show View → Error Log exposes internal Eclipse exceptions that never surface as compile errors. Distinguish compilation failures (javac-level, fixable in source or build path) from builder failures (plug-in or configuration exceptions). A project marked with a red X that shows no Problems entries often signals a builder crash—worth checking the Error Log and, if needed, recreating the project's metadata via a fresh import.
Metadata, .project, .classpath, and the heavier reset
Each Eclipse project carries a .project descriptor and, for Java, a .classpath file, plus a hidden .settings/ folder. These are configuration, not output, and a normal Clean does not touch them. If they are corrupted, symptoms include a project that won't build at all, missing natures, or a context menu lacking Java options.
The stronger reset is to delete the project without deleting contents on disk (right-click → Delete, leave "Delete project contents" unchecked), then File → Import → Existing Projects into Workspace and reselect the folder. This regenerates metadata from what Eclipse can infer, at the cost of losing custom settings. For Maven projects, Update Project is usually gentler and sufficient. Back up or commit before deleting metadata; there is no undo.
Automatic builds, and when to turn them off
"Build Automatically" is convenient but can mask what a clean does, because edits trigger partial builds continuously. Turning it off (Project menu) and building explicitly makes the sequence observable: clean, then build, then inspect. For large workspaces, disabling automatic builds speeds editing but risks forgetting to build before running—so re-enable it or build before every launch.
A reproducible checklist that generalizes
1: Save all files; commit or stash so the reset is reversible. 2: Project → Clean…, select the project(s); optionally "Build only the selected projects." 3: Confirm the build ran; read Problems and Console. 4: If output is still stale, Refresh (F5) the project. 5: If a Maven/Gradle project, run the build tool's own clean and refresh/update the project. 6: If metadata seems corrupt, re-import without deleting disk contents. 7: If errors persist, investigate build path, compiler compliance level, library duplicates, and file encoding—the rebuild cannot repair these.
Two illustrative, clearly hypothetical values: if a workspace has 40 projects and only one misbehaves, cleaning just that project is faster than "Clean all projects" (which forces a full recompile of everything); and if your output folder is customized to build/classes, Clean empties that folder, not bin/, so never assume the default path. These are examples of reasoning, not measurements.
Frequently asked questions
Does "Clean" delete my source code? No. It removes compiled output and derived files in the output/build folders, not your .java sources, subject to your configured output locations.
Why does it still show errors after a clean rebuild? Because the cause is configuration or source (build path, compliance level, duplicates, encoding), not stale derived state. A rebuild resets incremental state; it doesn't resolve missing dependencies.
Is there a keyboard shortcut for rebuild? Building has shortcuts that vary by binding, but "clean" is normally a menu/dialog action; check Window → Preferences → General → Keys for your installation rather than trusting a remembered shortcut.
Do I need to rebuild after changing only a resource? Usually no—Eclipse copies resources incrementally—but a clean-and-build is a safe, slower fallback when copies misbehave.
The reliable mental model: clean removes derived files, build regenerates them, and everything a rebuild can fix lives in derived state; everything it cannot fix lives in configuration or source. Match the tool you run (Eclipse builder vs. Maven/Gradle) to whichever system owns the output, and a "rebuild" stops being a guessing game.