cd /news/developer-tools/javadoc-wtf-4mb-of-fonts-jdk-23 · home topics developer-tools article
[ARTICLE · art-115154] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=· neutral

JavaDoc WTF 4MB of Fonts JDK 23+

A developer discovered that starting with JDK 23, the javadoc tool embeds default DejaVu web font files (about 4 MB) into generated API documentation, causing unexpectedly large artifacts. The issue can be resolved by configuring the maven-javadoc-plugin to pass the --no-fonts flag, either via plugin configuration or the -Dmaven.javadoc.disableNoFonts=true property.

read1 min views1 publishedAug 29, 2026

I was publishing two small packages to maven central and saw that they added usage tracking. I clicked and noticed 8MB number that should not be caused by 2 tiny packages, it was supposed to be kilobytes.

What happened wass that starting in JDK 23, the JDK javadoc

tool began embedding default DejaVu web font files (~4 MB) into generated API documentation. The maven-javadoc-plugin

passes the JDK's --no-fonts

flag to disable this.

Option 1: Plugin Configuration

To disable copying web fonts across builds, set <disableNoFonts>false</disableNoFonts>

(or explicitly pass additional arguments if running older toolchains) in your pom.xml

:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>3.11.3</version>
    <configuration>
        <!-- Disables font inclusion in JDK 23+ -->
        <additionalOptions>
            <additionalOption>--no-fonts</additionalOption>
        </additionalOptions>
    </configuration>
</plugin>

Option 2: Property Switch or Maven Property

You can also control this property directly via the Maven property or command-line flag without modifying your execution configuration:

mvn clean javadoc:javadoc -Dmaven.javadoc.disableNoFonts=true

JDK Compatibility Note:The--no-fonts

option was introduced inJDK 23. If you use JDK 21 or earlier, explicitly passing--no-fonts

will cause the JDKjavadoc

executable to throw an unrecognized option error.

── more in #developer-tools 4 stories · sorted by recency
── more on @jdk 23 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/javadoc-wtf-4mb-of-f…] indexed:0 read:1min 2026-08-29 ·