This is an automated email from the ASF dual-hosted git repository. jimjag pushed a commit to branch AOO42X in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit e39e878c0ac40c497a5fa0ba0a8b501cdba4d2d6 Author: Jim Jagielski <[email protected]> AuthorDate: Thu Jun 11 17:21:31 2026 -0400 Point JNI includes at the JDK on macOS, not the dead JavaVM.framework jvmaccess (and any JNI consumer) fails to compile on modern macOS: jvmaccess/inc/jvmaccess/virtualmachine.hxx:32: fatal error: 'jni.h' file not found set_soenv.in's darwin branch added the JNI headers from $MACOSX_SDK_PATH/System/Library/Frameworks/JavaVM.framework/Headers. That is Apple's old bundled-Java layout, removed ~2017; the framework no longer ships jni.h. A real JDK (Oracle/OpenJDK/Temurin/Semeru, e.g. via --with-jdk-home) puts the headers in $JAVA_HOME/include and $JAVA_HOME/include/darwin (jni_md.h) -- the same include/<os> layout already used for Linux/Solaris/BSD. Add those two dirs to SOLARINC on darwin (guarded by the same JDK!=gcj check as the other platforms) and drop the dead framework path. FRAMEWORKSHOME is still set/exported for other framework references. Verified the generated -I paths resolve to the existing jni.h/jni_md.h of an installed JDK 21. --- main/set_soenv.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main/set_soenv.in b/main/set_soenv.in index a96ea2bcb8..3d08d7ee37 100644 --- a/main/set_soenv.in +++ b/main/set_soenv.in @@ -1522,7 +1522,15 @@ elsif ($platform =~ m/darwin/) # Xcode 5 $STLINC = "$TOOLSPATH/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/"; } - $SOLARINC .= $I.$STLINC . $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Headers"; + $SOLARINC .= $I.$STLINC; + # JNI headers. The old Apple JavaVM.framework/Headers/jni.h is gone + # (removed by Apple ~2017); a real JDK (Oracle/OpenJDK/Temurin/Semeru) + # puts them in $JAVA_HOME/include and $JAVA_HOME/include/darwin (jni_md.h), + # matching the layout used for the other platforms above. + if (!($JDK eq "gcj")) + { $SOLARINC .= $I.'$JAVA_HOME'.$INCLUDE. + $I.'$JAVA_HOME'.$INCLUDE.$ds."darwin"; + } $GUIBASE = "aqua"; } else
