After macOS 15.x, the next newer version of macOS is now 26 (currently in beta https://developer.apple.com/documentation/macos-release-notes/macos-26-release-notes ). JDK, when building on macOS, recommends the use of XCode 15.4 https://github.com/openjdk/jdk/blob/master/doc/building.md :
> It is recommended that you use at least macOS 14 and Xcode 15.4, but earlier versions may also work.
When using this version of XCode to build the JDK on macOS 26 (Beta), the "kern.osproductversion" sysctl configuration reports the macOS version as 16.0. Other parts of macOS ecosystem report a different and more correct version. For example, the "sw_vers" returns this on macOS 26 Beta:
sw_vers
ProductName: macOS
ProductVersion: 26.0
BuildVersion: 25A5295e
The JDK code in os_bsd.cpp uses sysctlbyname("kern.osproductversion"...) to obtain the macOS version. This is then printed out in the VM error reports and the output of the newly introduced -XX:+PrintVMInfoAtExit java option. When the JDK is built using XCode 15.4 and VM report is then generated at runtime, then the "Host" line in that output looks as follows for macOS 26:
Host: "foobar" arm64, N cores, ... Darwin 25.0.0, macOS 16.0 (25A5295e)
Notice the incorrect 16.0 in the output.
The void os::get_summary_os_info(char* buf, size_t buflen) function in os_bsd.cpp needs to be updated to take into account this version mismatch. A similar fix was recently done in the JDK mainline in a different part of the JDK throughJDK-8359830.
> It is recommended that you use at least macOS 14 and Xcode 15.4, but earlier versions may also work.
When using this version of XCode to build the JDK on macOS 26 (Beta), the "kern.osproductversion" sysctl configuration reports the macOS version as 16.0. Other parts of macOS ecosystem report a different and more correct version. For example, the "sw_vers" returns this on macOS 26 Beta:
sw_vers
ProductName: macOS
ProductVersion: 26.0
BuildVersion: 25A5295e
The JDK code in os_bsd.cpp uses sysctlbyname("kern.osproductversion"...) to obtain the macOS version. This is then printed out in the VM error reports and the output of the newly introduced -XX:+PrintVMInfoAtExit java option. When the JDK is built using XCode 15.4 and VM report is then generated at runtime, then the "Host" line in that output looks as follows for macOS 26:
Host: "foobar" arm64, N cores, ... Darwin 25.0.0, macOS 16.0 (25A5295e)
Notice the incorrect 16.0 in the output.
The void os::get_summary_os_info(char* buf, size_t buflen) function in os_bsd.cpp needs to be updated to take into account this version mismatch. A similar fix was recently done in the JDK mainline in a different part of the JDK through
- relates to
-
JDK-8359830 Incorrect os.version reported on macOS Tahoe 26 (Beta)
-
- Resolved
-