From cea0f7c42775813b60b3ec99fe239f2e7075e127 Mon Sep 17 00:00:00 2001 From: bu99ed <83012222+bu99ed@users.noreply.github.com> Date: Sun, 4 Jan 2026 00:26:40 +0100 Subject: [PATCH] set source & target version java compile flags in cmake build to match the python/make build for consistent bytecode generation (#8112) Co-authored-by: bu99ed --- src/api/java/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/java/CMakeLists.txt b/src/api/java/CMakeLists.txt index 2afd6ad56..533d36604 100644 --- a/src/api/java/CMakeLists.txt +++ b/src/api/java/CMakeLists.txt @@ -188,6 +188,8 @@ add_custom_target(build_z3_java_bindings # TODO: Should we set ``CMAKE_JNI_TARGET`` to ``TRUE``? # REMARK: removed VERSION to fix issue with using this to create installations. +set(CMAKE_JAVA_COMPILE_FLAGS -source 1.8 -target 1.8) + add_jar(z3JavaJar SOURCES ${Z3_JAVA_JAR_SOURCE_FILES_FULL_PATH} OUTPUT_NAME ${Z3_JAVA_PACKAGE_NAME}