File: 0002-update-java-source-target-flags.patch

package info (click to toggle)
ceph 18.2.8%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,186,356 kB
  • sloc: cpp: 6,282,106; ansic: 3,507,390; python: 375,284; asm: 216,381; java: 133,450; sh: 125,595; xml: 39,398; ruby: 32,026; makefile: 29,004; javascript: 23,994; cs: 18,980; perl: 9,709; sql: 7,833; lisp: 5,920; pascal: 3,109; ada: 1,681; yacc: 478; awk: 188; f90: 55; php: 1
file content (20 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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})