File 3008-update-java-source-target-flags.patch of Package ceph-ceph-19.2.3
Description: use --release 8 instead of -source/-target
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 minimum compatibility release has been updated to 8.
Author: Tiago Stürmer Daitx <tiago.daitx@ubuntu.com>
Bug-Ubuntu: https://launchpad.net/bugs/1756854
Bug-Ubuntu: https://launchpad.net/bugs/1766998
Forwarded: no
Last-Update: 2018-04-24
---
--- a/src/java/CMakeLists.txt
+++ b/src/java/CMakeLists.txt
@@ -15,13 +15,7 @@
java/com/ceph/fs/CephStat.java
java/com/ceph/fs/CephStatVFS.java)
-# note: for the -source 1.7 builds, we add
-# -Xlint:-options
-# to get rid of the warning
-# 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" $ENV{JAVA_TARGET_RELEASE} "-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})
--- a/src/rocksdb/java/CMakeLists.txt
+++ b/src/rocksdb/java/CMakeLists.txt
@@ -4,7 +4,7 @@
message("Please consider switching to CMake 3.11.4 or newer")
endif()
-set(CMAKE_JAVA_COMPILE_FLAGS -source 7)
+set(CMAKE_JAVA_COMPILE_FLAGS -source $ENV{JAVA_TARGET_RELEASE})
set(JNI_NATIVE_SOURCES
rocksjni/backup_engine_options.cc