Urgent.News

What's breaking now, across thousands of outlets.

Tech

JavaDoc WTF 4MB of Fonts JDK 23+

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…

Java developers utilizing Maven Central to publish packages may have encountered unexpected 8MB usage, seemingly unrelated to their small packages. This phenomenon emerged with JDK 23, as the JDK javadoc tool began embedding default DejaVu web font files (~4 MB) into generated API documentation. To counteract this, the maven-javadoc-plugin offers a solution.

Firstly, plugin configuration enables disabling font inclusion in JDK 23+ builds. Within your pom.xml, set the <configuration> element to include "additionalOptions" with the "--no-fonts" argument. This configuration effectively neutralizes the unintended inclusion of 4MB font files in your documentation.

Alternatively, the property switch or Maven property provides a direct method to control this behavior without modifying plugin configurations. By using the Maven command "mvn clean javadoc:javadoc" followed by the "-Dmaven.javadoc.disableNoFonts=true" flag, developers can prevent the inclusion of web fonts in their documentation. However, this approach is viable only if JDK 23 is used; previous versions will reject the unrecognized option, throwing an error.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Database Reliability: The SRE Approach to Keeping Data Safe

The Backup That Wasn't We had backups. Daily snapshots to S3. Perfectly configured. Never tested. When we needed to restore after a data corruption incident, we discovered the backups had been…

  • Weekly restore test script checks for backup failures and data discrepancies
  • PostgreSQL replication monitoring alerts when lag exceeds thresholds
  • Key dashboard panels track active connections, query latency, and disk usage

More from Saturday 29 August →