=== Improve OpenJDK on FreeBSD

Links: +
link:https://freebsdfoundation.org/project/improving-openjdk-on-freebsd/[Project description] URL: https://freebsdfoundation.org/project/improving-openjdk-on-freebsd/[] +
link:https://github.com/freebsd/openjdk[Project repository] URL: https://github.com/freebsd/openjdk[] +
link:https://github.com/openjdk/bsd-port[Upstream BSD port repo] URL: https://github.com/openjdk/bsd-port[]

Contact: +
Harald Eilertsen <haraldei@FreeBSD.org> +
FreeBSD Java mailing list <freebsd-java@lists.freebsd.org>

The goal of this project is to improve OpenJDK support for FreeBSD/amd64 and FreeBSD/arm64.

Java is an important runtime environment for many high performance, critical enterprise systems.
Making sure Java based applications run correctly and efficiently on FreeBSD is important to ensure that FreeBSD will continue to be a viable and attractive platform for enterprises, as well as businesses and organizations of all sizes.

In this quarter the following issues/milestones were reached:

* Updated OpenJDK 25 port to link:https://reviews.freebsd.org/D55529[version 25.0.2].
* Fixed an issue with building headless OpenJDK 25 variants link:https://reviews.freebsd.org/D55589[when no xorg libs were present].
* Reworked the way OpenJDK ports link:https://kodeknekkeriet.net/en/blog/bootstrapping-openjdk-freebsd-ports/[are bootstrapped] on FreeBSD:
  - link:https://reviews.freebsd.org/D54683[D54683]: OpenJDK 8-20
  - link:https://reviews.freebsd.org/D54731[D54731]: OpenJDK 21-25
* Fixed and improved Serviceability Agent for FreeBSD in mainline BSD port:
  - link:https://github.com/battleblow/jdk/pull/38[Undo breakage] caused by upstream macOS port.
  - Fixed link:https://github.com/battleblow/jdk/pull/38/changes/c1c498392ee10b0c35e8078f11cc975b9f1df5fb[obtaining stack traces from threads] in process being traced.
  - Fixed link:https://github.com/battleblow/jdk/pull/42[spurious issue] where symbol lookup of native symbols from shared objects would sometimes fail.
  - link:https://github.com/battleblow/jdk/pull/38/changes/39130dd99897437101169bddc032431ecf259461[Simplified function] for reading arbitrary memory from traced process.
* Enabled link:https://github.com/battleblow/jdk/pull/41[building/installing the Hotspot Disassembler] (HSDIS) for FreeBSD.
  This is needed for some tests for Aarch64 to check that Hotspot generates the correct instruction sequences in various environments.
  Only supporting the llvm backend for now, though there is no reason to believe the others would not work.
* link:https://github.com/battleblow/jdk/pull/40[Synced ThreadWXEnable implementation] with macOS.
  This enables Hotspot to toggle Write/Execute access to memory segments so that it can generate code to later be executed on Aarch64.
  Just a minor tweak so we align with the API used by the macOS code, even though our implementation is different.
* Backported BSD related changes from mainline to link:https://github.com/battleblow/jdk25u/pull/11[OpenJDK 25] and link:https://github.com/battleblow/jdk26u/pull/3[OpenJDK 26] ports.
* Added new link:https://reviews.freebsd.org/D55938[port for OpenJDK 26].
  Thanks to Greg Lewis and Kurt Miller for helping.
* Merged link:https://github.com/openjdk/bsd-port/pull/4[first PR] into upstream BSD port repo!

Other notes:

* Started work on updating OpenJDK 25 to version 25.0.3, scheduled for mid April release.
* I will be talking about the project and my experience working on it at the link:https://foss-north.se/2026/speakers-and-talks.html#heilertsen[foss-north] conference in Gothenburg, Sweden, on April 28.

Sponsor: The FreeBSD Foundation
