DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk2 min

How OpenJDK Builds javac—and What That Does (and Doesn’t) Test

OpenJDK’s JDK build uses an earlier compiler to build a new javac, then puts that compiler to work in later stages. Here’s why that is bootstrapping, not proof of correctness.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The sequence, in plain terms

  1. Start with a working JDK. It can run Java tools and compile the source needed for the bootstrap stage.
  2. Build a new compiler. The boot JDK produces javac and other tools in the first phase.
  3. 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.