Created attachment 269549 [details] Patch for openjdk25 headless install w/o Xorg libs As it is, java/openjdk25 always pulls in and installs Xorg libs, even in the case of a headless install, which should by definition not require any Xorg libs installed. This is because of 'USES = xorg'. I have concocted a simple Makefile patch that avoids installing various Xorg libs as mandatory dependencies in case of a headless install, and only requires five header files as BUILD_DEPENDS.
(In reply to Raivo Hool from comment #0) Sorry I didn't respond to this sooner. I think the suggestion is interesting! Have you done much testing of the headless JVM on a system without these libs installed?
I've been running Apache Solr and Tika with OpenJDK 25 headless built that way, since April without a single glitch.
(In reply to Raivo Hool from comment #2) Nice! I'll see about merging the patch as soon as I can.
Created attachment 273776 [details] Patch for openjdk25 headless install w/o Xorg libs ^Triage: update patch so that it will apply properly.
(In reply to Raivo Hool from comment #2) Hi, see the comments on the review here: https://reviews.freebsd.org/D59167 Are the BUILD_DEPENDS lines really necessary?
(In reply to Harald Eilertsen from comment #5) They are no longer necessary. I made the patch for 25.0.3, and for that version, those lines were a must, but building headless was fixed in 25.0.4: https://mail.openjdk.org/archives/list/jdk-updates-dev@openjdk.org/thread/BRREMPN6BLLC2CYAKLXGRHHNMCIQQSR5/ "- JDK-8376684: Compile OpenJDK in headless mode without required X11 libraries"
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9c0054517dd7d300ae4950a7d3004c70f02976c9 commit 9c0054517dd7d300ae4950a7d3004c70f02976c9 Author: Raivo Hool <raivo@lehma.com> AuthorDate: 2026-08-25 08:45:31 +0000 Commit: Harald Eilertsen <haraldei@FreeBSD.org> CommitDate: 2026-09-01 08:07:34 +0000 java/openjdk{25,26}: Don't req xorg for headless We no longer need the xorg libs to build OpenJDK headless variants for OpenJDK 25 and 26. Relevant upstream JBS issues: - OpenJDK 25.0.4: https://bugs.openjdk.org/browse/JDK-8381011 - OpenJDK 26.0.2: https://bugs.openjdk.org/browse/JDK-8378158 PR: 294358 Reported by: raivo@lehma.com Reviewed by: haraldei, jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D59167 java/openjdk25/Makefile | 9 ++++++++- java/openjdk26/Makefile | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-)