use --release 7 instead of -source/-target
authorTiago Stürmer Daitx <tiago.daitx@ubuntu.com>
Thu, 16 Feb 2023 10:54:41 +0000 (10:54 +0000)
committerThomas Goirand <zigo@debian.org>
Thu, 16 Feb 2023 10:54:41 +0000 (10:54 +0000)
Bug-Ubuntu: https://launchpad.net/bugs/1756854
Bug-Ubuntu: https://launchpad.net/bugs/1766998
Forwarded: no
Last-Update: 2018-04-24

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 11 minimum compatibility release has been updated to 7.
Last-Update: 2018-04-24
Gbp-Pq: Name update-java-source-target-flags.patch

src/java/CMakeLists.txt

index 62b5259c9d2c80667f6f461edb0a60356086ac7b..ce470db2a56849cdafdd3d753ca44d827b361cf5 100644 (file)
@@ -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" "7" "-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})