JDK 23 JavaDoc Now Embeds 4MB DejaVu Fonts by Default, Here's How to Disable It
Starting with JDK 23, the JavaDoc tool automatically embeds DejaVu web font files of approximately 4MB into generated API documentation, significantly inflating package sizes. A developer noticed the issue while publishing small Maven packages to Maven Central, where an unexpected 8MB usage figure prompted investigation. The maven-javadoc-plugin offers a built-in fix via the --no-fonts flag, which can be enabled through pom.xml configuration or a Maven command-line property. Developers can also use the -Dmaven.javadoc.disableNoFonts=true flag during builds to suppress font embedding without modifying project files. Importantly, the --no-fonts option is only available from JDK 23 onward, and using it with JDK 21 or earlier will result in an unrecognized option error.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in