The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →OpenJDK builds a new javac with an existing JDK, then uses that newly built compiler in later stages of the JDK build. This is compiler bootstrapping: it shows the new compiler can participate in the build, but it does not by itself prove that javac is correct. OpenJDK documents javac regression testing separately.
Can a Java compiler compile itself?
Yes, as part of a staged build. The JDK build starts with a working JDK already available. That earlier JDK runs the build tools and compiles the bootstrap-compatible source needed to produce a new javac. Later, the build uses that newly created compiler to compile additional JDK classes.
As an Amazon Associate I earn from qualifying purchases.
OpenJDK’s current JDK build guide describes the JDK as able to build itself and says an up-to-date build of current JDK source is an acceptable boot JDK. The detailed langtools build description spells out the two phases: first, the boot JDK builds javac and other tools; second, required classes are compiled with the latest javac produced in the first phase. That file describes a source-tree build, so its implementation details should not be assumed to apply unchanged to every modern JDK.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteThe sequence, in plain terms
- Start with a working JDK. It can run Java tools and compile the source needed for the bootstrap stage.
- Build a new compiler. The boot JDK produces javac and other tools in the first phase.
- Use the new compiler downstream. Later compilation stages use the javac just built to compile more of the JDK.
This resolves the circular dependency operationally: the build does not begin with nothing. It starts from an earlier working compiler and uses it to make the next one.
#1 Best Overall
What does “its own test case” mean here?
It is a useful metaphor for the build-and-test relationship, not a documented historical incident established by the available primary sources. When the newly built compiler is used in later JDK compilation, the build demonstrates that it can take part in that concrete workflow. It does not establish that every language feature, diagnostic, edge case, or compiler API behaves correctly.
Build participation and regression testing answer different questions. A successful build exercises compilation needed by that build; a regression suite runs tests intended to detect incorrect behavior. Neither should be presented as a substitute for the other.
How does OpenJDK test javac?
OpenJDK’s Testing the JDK guide says most JDK tests use jtreg, a regression-test framework and runner built for the JDK’s needs. The guide’s tier1 test description includes the javac compiler and calls tier1 the fundamental test tier. This establishes that javac is included in the JDK’s regression-testing system; it does not provide a test count, coverage percentage, or pass rate.
Recommended Free Tools
What javac is—and what it is not
javac is the Java compiler, not the Java Virtual Machine. Oracle’s Java SE 26 documentation for the jdk.compiler module defines it as the module containing the system compiler implementation and its command-line equivalent, javac. The module also provides the JavaCompiler and ToolProvider interfaces for invoking the compiler, along with the Compiler Tree API for working with source trees.
Rank #3
The javac command documentation describes compiling for earlier platform releases with --release or with --source and --target, subject to platform-specific constraints. Those current compiler capabilities are separate from the bootstrap mechanism: they describe how javac can be used, not why self-compilation alone would validate it.
Quick Recap
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




