Author: Tiago Stürmer Daitx <tiago.daitx@ubuntu.com>
Description: use --release 7 instead of -source/-target (Closes: LP:1756854, LP: 1766998)
 Instead of -source/-target ceph should be build with --release for OpenJDK 9
 or later so that the bootclasspath is also set, as per JEP-247, otherwise it
 risks incurring into binary incompatibility when run with an earlier OpenJDK.
 .
 OpenJDK 21 minimum compatibility release has been updated to 8.

diff -Naurp ceph.orig/src/java/CMakeLists.txt ceph/src/java/CMakeLists.txt
--- ceph.orig/src/java/CMakeLists.txt
+++ ceph/src/java/CMakeLists.txt
@@ -21,7 +21,7 @@ set(java_srcs
 #   warning: [options] bootstrap class path not set in conjunction with -source 1.7
 # as per
 #   https://blogs.oracle.com/darcy/entry/bootclasspath_older_source
-set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.8" "-target" "1.8" "-Xlint:-options")
+set(CMAKE_JAVA_COMPILE_FLAGS "--release" "8" "-Xlint:-options")
 set(jni_header_dir "${CMAKE_CURRENT_BINARY_DIR}/native")
 if(CMAKE_VERSION VERSION_LESS 3.11)
   set(CMAKE_JAVA_COMPILE_FLAGS ${CMAKE_JAVA_COMPILE_FLAGS} "-h" ${jni_header_dir})
