On 16-CURRENT I'm using openjdk25 installed by pkg: FreeBSD_version: 1600019 build_timestamp: 2026-07-25T01:04:44+0000 built_by : poudriere-git-3.4.8 cpe : cpe:2.3:a:oracle:openjdk:25.0.3+9.f.1:::::freebsd16:x64 flavor : jdk port_checkout_unclean: no port_git_hash : a775e64d13a6bb7f4e5133105227f37fdc87a882 ports_top_checkout_unclean: no ports_top_git_hash: 7c53142d6b1d65fc3b37c1ce6ee6b703206261e2 repo_type : binary repository : FreeBSD-ports and it seems linked against openjdk11: $ ldd /usr/local/openjdk25/lib/libjava.so /usr/local/openjdk25/lib/libjava.so: libjvm.so => /usr/local/openjdk11/lib/server/libjvm.so (0x1290b8e00000) libdl.so.1 => /usr/lib/libdl.so.1 (0x1290ba54d000) libc.so.7 => /lib/libc.so.7 (0x1290b763b000) libm.so.5 => /lib/libm.so.5 (0x1290b6423000) libc++.so.1 => /lib/libc++.so.1 (0x1290ba700000) libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x1290bb289000) libthr.so.3 => /lib/libthr.so.3 (0x1290bbe74000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x1290bbf95000) libsys.so.7 => /lib/libsys.so.7 (0x1290b7b74000) Actually, openjdk11 is installed on this machine. After removing it, ldd reports a missing libjvm.so: $ ldd /usr/local/openjdk25/lib/libjava.so /usr/local/openjdk25/lib/libjava.so: libjvm.so => not found (0) libdl.so.1 => /usr/lib/libdl.so.1 (0x3721ac186000) libc.so.7 => /lib/libc.so.7 (0x3721ad00c000) Same thing on another machine running 15.1-RELEASE. libjvm.so exists for OpenJDK25, it is installed as /usr/local/openjdk25/lib/server/libjvm.so but I guess that the linker missed some LDFLAGS with "-Wl,-rpath=$JAVA_HOME/lib/server". With LD_LIBRARY_PATH=/usr/local/openjdk25/lib/server everything is OK.
Thanks for reporting! I'll look into it.
The problem seems to be that while libjava.so is located in /usr/local/openjdkXX/lib, libjvm.so is located in /usr/local/openjdkXX/lib/server (assuming the server build, which is the default.) However, the DT_RUNPATH of libjava.so is set only to `$ORIGIN`, which makes the loader not look in the `server/` directory under it. stigmata% readelf -d /usr/local/openjdk25/lib/libjava.so|grep 'R.*PATH' 0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN] Adding `$ORIGIN/server` to the library runpath seems to solve the issue. I still don't understand why it insist on picking OpenJDK11 as the default, though. A bit more work is needed to make the patch more generic, but I hope to be able to update the ports within the week or early next week.
Went for a different approach instead, removed the USE_LDCONFIG line from the OpenJDK8 and 11 ports. This will make ldd report that it can't find libjvm.so regardless of which jdk version are installed. Since OpenJDK loads the libs explicitly at runtime, this should not be a problem.
Forgot the link to the review: https://reviews.freebsd.org/D58841
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9477c9da0a436a689b99443372a80f20186ee7a9 commit 9477c9da0a436a689b99443372a80f20186ee7a9 Author: Harald Eilertsen <haraldei@FreeBSD.org> AuthorDate: 2026-08-14 10:19:14 +0000 Commit: Harald Eilertsen <haraldei@FreeBSD.org> CommitDate: 2026-08-17 10:25:52 +0000 java/openjdk{8,11}: Remove USE_LDCONFIG from ports OpenJDK loads the JVM and other JDK libraries explicitly from the correct directories, so there's no need for adding them to ldconfig. PR: 297282 Reviewed by: jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58841 java/openjdk11/Makefile | 2 +- java/openjdk8/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
This issue should be fixed in the ports main branch now. Let me know if I can close the bug.