--- cmake-3.22.2/Modules/FindJNI.cmake.orig 2022-01-25 14:45:06.000000000 +0100
+++ cmake-3.22.2/Modules/FindJNI.cmake 2022-02-15 19:29:09.377305753 +0100
+@@ -52,7 +52,7 @@
+ # 1.6.0_18 + icedtea patches. However, it would be much better to base the
+ # guess on the first part of the GNU config.guess platform triplet.
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+- if(CMAKE_LIBRARY_ARCHITECTURE STREQUAL "x86_64-linux-gnux32")
++ if(CMAKE_LIBRARY_ARCHITECTURE STREQUAL "x86_64-linux-gnux32" OR LIB_SUFFIX STREQUAL "x32")
+ set(_java_libarch "x32" "amd64" "i386")
+ else()
+ set(_java_libarch "amd64" "i386")
@@ -188,49 +188,27 @@ if (WIN32)
endif()