'(Building) OpenJDK 11 on Mac OS X 10.9.5?

Does anyone know of an OpenJDK 11 build for Mac OS X 10.9.5, or whether it's possible to build it on that OS version?

Having only an X11 GUI would be fine.

EDIT: I've only found binary installers that require at least OS X 10.10 and no information that is specific to the minimum required OS version for building from source independently from the minimum required clang version. OS version 12 is advised but that is presumably because Apple's xcode only contains a new enough clang version starting from that release: one can build for 10.9. Conversely, 10.9 does have a 10.10 SDK and it is no problem to install newer clang versions (I have clang 5.0.1 and 9.0.1 installed). I did not find any information whatsoever on building for X11 instead of native graphics (IOW, treat the Mac as a regular BSD/Posix workstation). That should cut a large part of the "this requires a newer OS" code out of the equation but is evidently not something any of the regular vendors will consider.



Solution 1:[1]

Good question. First you should distinguish between the min OS required by the installer and the min OS that the JDK binaries actually target. Even though the installers may enforce a requirement of >= 10.10, up until Feb 2022 or so, JDK 11 actually targeted 10.9, and similarly up until Jan 2021 JDK 17 targeted 10.9.

You can see more info in https://bugs.openjdk.java.net/browse/JDK-8260518 as well as the associated patches.

This means that even though the installers might not support it, most JDK 11 builds you find (at least those made before Feb 2022) should in fact work fine on 10.9. The installers may complain, but you can always manually install to /Library/Java.

Solution 2:[2]

Building from the OpenJDK codebase is possible, but not recommended because of its size and complexity.

Instead, I suggest you rummage around the offerings and archives of the several vendors offering JDK binaries and installers for macOS. These include, in no particular order: Adoptium (AdoptOpenJDK), Microsoft, Oracle, Azul Systems, SAP, Pivotal, BellSoft, Amazon, and maybe more.

Solution 3:[3]

Not an actual answer to my question but a solution to the underlying problem:

SAP provide v11 JDK and JRE that still run on OS X 10.9.5 .

Certain features will not work, like those requiring "Apple EAWT" and (thus?) "Mac OS X GUI integration" but this seems to be handled gracefully enough. These most certainly wouldn't work with an X11 build either.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 1110101001
Solution 2
Solution 3 RJVB