{"slug": "javadoc-wtf-4mb-of-fonts-jdk-23", "title": "JavaDoc WTF 4MB of Fonts JDK 23+", "summary": "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.", "body_md": "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.\n\nWhat happened wass that starting in JDK 23, the JDK `javadoc`\n\ntool began embedding default DejaVu web font files (~4 MB) into generated API documentation. The `maven-javadoc-plugin`\n\npasses the JDK's `--no-fonts`\n\nflag to disable this.\n\n**Option 1: Plugin Configuration**\n\nTo disable copying web fonts across builds, set `<disableNoFonts>false</disableNoFonts>`\n\n(or explicitly pass additional arguments if running older toolchains) in your `pom.xml`\n\n:\n\n```\n<plugin>\n    <groupId>org.apache.maven.plugins</groupId>\n    <artifactId>maven-javadoc-plugin</artifactId>\n    <version>3.11.3</version>\n    <configuration>\n        <!-- Disables font inclusion in JDK 23+ -->\n        <additionalOptions>\n            <additionalOption>--no-fonts</additionalOption>\n        </additionalOptions>\n    </configuration>\n</plugin>\n```\n\n**Option 2: Property Switch or Maven Property**\n\nYou can also control this property directly via the Maven property or command-line flag without modifying your execution configuration:\n\n```\nmvn clean javadoc:javadoc -Dmaven.javadoc.disableNoFonts=true\n```\n\nJDK Compatibility Note:The`--no-fonts`\n\noption was introduced inJDK 23. If you use JDK 21 or earlier, explicitly passing`--no-fonts`\n\nwill cause the JDK`javadoc`\n\nexecutable to throw an unrecognized option error.", "url": "https://wpnews.pro/news/javadoc-wtf-4mb-of-fonts-jdk-23", "canonical_source": "https://dev.to/hrgdavor/javadoc-wtf-4mb-of-fonts-jdk-23-153a", "published_at": "2026-08-29 13:50:09+00:00", "updated_at": "2026-08-29 14:19:04.597043+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["JDK 23", "maven-javadoc-plugin", "DejaVu", "Maven"], "alternates": {"html": "https://wpnews.pro/news/javadoc-wtf-4mb-of-fonts-jdk-23", "markdown": "https://wpnews.pro/news/javadoc-wtf-4mb-of-fonts-jdk-23.md", "text": "https://wpnews.pro/news/javadoc-wtf-4mb-of-fonts-jdk-23.txt", "jsonld": "https://wpnews.pro/news/javadoc-wtf-4mb-of-fonts-jdk-23.jsonld"}}