From: WANG Xuerui Date: Tue, 13 Aug 2024 16:06:38 +0800 Subject: Support finding libjvm.so for all OpenJDK variants Formerly only the "client" and "server" variant directories are being checked for libjvm.so, but according to a 2021 OpenJDK upstream change present in OpenJDK >= 18, there can be "minimal" and "zero" variants as well. In particular, formerly (OpenJDK <= 17) the Zero variant had its libjvm.so in "server/", but "zero/" in newer versions, which regressed downstream CMake project builds running on systems with OpenJDK Zero VM. Fix it by checking all 4 variant directories for libjvm.so. Forwarded: not-needed Origin: upstream, https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9725 Bug-Debian: https://bugs.debian.org/1078712 --- Modules/FindJNI.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index abc76cf..51f05b9 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -343,7 +343,9 @@ foreach(dir IN LISTS JAVA_AWT_LIBRARY_DIRECTORIES) list(APPEND JAVA_JVM_LIBRARY_DIRECTORIES "${dir}" "${dir}/client" + "${dir}/minimal" "${dir}/server" + "${dir}/zero" # IBM SDK, Java Technology Edition, specific paths "${dir}/j9vm" "${dir}/default"