As you may know, a JDK built on macOS 14 using the macOS 14 SDK crashes during 
initialization of AWT.

(The problem appears to be Apple’s bug. It is triggered by a runtime check that 
is enabled only in programs that were linked against the macOS 14 SDK.)

So I tried to build JDK using the macOS 13 SDK (specifically, I was building 
jdk21u).

I tried both suggestions in the build documentation for configuring the Xcode 
version.

The first suggestion was to use xcode-select to select the previous version of 
Xcode (version 14), which contains the macOS 13 SDK.

This suggestion is ugly because Xcode 14 does not run on macOS 14, but it might 
have worked.

However, the suggestion failed because I started getting warnings like this:

"The shared archive file was created by a different version or build of HotSpot”

Even worse, however, is that these warnings *were inserted in generated Java 
sources*, causing the build to fail.

For example:

package sun.awt;
public class AWTIcon32_security_icon_interim16_png {
public static int[] security_icon_interim16_png = { 
[0.016s][warning][cds] The shared archive file was created by a different 
version or build of HotSpot
...

I then tried the second suggestion, configuring with 
--with-toolchain-path=/Applications/Xcode14.app/Contents/Developer/usr/bin.

This appears to work.

Reply via email to