Enable Eclipse JDT Incremental Compilation for Faster Java Rebuilds
Learn how to turn on Eclipse JDT incremental compilation to cut rebuild times when editing Java source files.
08 Apr 2026, 12:12 UTC

Desired outcome
Reduce the time Eclipse spends rebuilding a Java project after a source change by enabling JDT incremental compilation, which recompiles only the modified classes.
Prerequisites
- Eclipse IDE 2023-09 (or newer) with the Java Development Tools (JDT) plug‑in installed.
- A Java project that already has a JRE configured and is part of the workspace.
- Workspace setting
Build automaticallyenabled (found underProject → Build Automatically). - Write access to the Eclipse installation directory if you need to adjust the JVM heap in
eclipse.ini.
Procedure
- Open project properties: Right‑click the project in the Package Explorer and choose
Properties. - Enable incremental building: In the properties dialog select
Java Compiler → Building. Ensure the checkboxBuild automaticallyis ticked (this mirrors the workspace setting) and thatEnable incremental compilationis selected. - Confirm JDT compiler compliance: Still under
Java Compiler, set theCompiler compliance levelto match your project’s JRE (e.g., 17 for JDK 17). ClickApply and Close. - Perform a clean build: Choose
Project → Clean…, select your project, and start the clean. This removes any previously compiled output and guarantees a known baseline. - Trigger an incremental rebuild: Open a Java source file, make a small change (e.g., add a comment or modify a method body), and save the file. Because
Build automaticallyis on, Eclipse will start an incremental build immediately. - Observe the Build Console: Open the
Build Consoleview (Window → Show View → Other… → General → Build Console). Look for a line similar to:
[incremental] Building project 'MyJavaApp' incrementally
The presence of the word incremental indicates that only the changed class was recompiled.
Expected checks
- Compare build times: note the duration of the clean build (shown in the Build Console) and the duration of the incremental build after your edit. The incremental build should be noticeably shorter (often a few hundred milliseconds versus several seconds for a clean build).
- Verify output: Incremental builds should list only the modified class (e.g.,
MyClass.class) under the[incremental]section, while a clean build lists all classes. - Check for stale files: After several incremental edits, run the project’s unit tests (
Run → JUnit Test) to ensure no outdated class files remain; passing tests confirm correctness.
Limitations and practical verification
- Incremental compilation may not detect changes to annotation processors or generated sources. If you modify such files, perform a clean build to refresh derived artifacts.
- In large multi‑module workspaces the incremental mode can increase heap usage. Monitor Eclipse’s memory consumption (
Window → Preferences → General → Memory and Thread Pools) and, if needed, increase the heap ineclipse.ini:
-Xmx2g
Replace 2g with a value suitable for your machine; ensure you have write permission to eclipse.ini and restart Eclipse after editing.
Recovery options (rollback)
If you discover that incremental builds are causing unexpected behavior (e.g., stale class files), you can revert to a full clean build workflow:
- Open
Project → Properties → Java Compiler → Building. - Uncheck
Enable incremental compilation. - Click
Apply and Close. - Run
Project → Clean…on the affected projects to obtain a clean state.
This restores the original behavior without requiring a reinstall of Eclipse.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.