Problem
The CMake build system compiles the Java bindings with the JDK version of the build environment as target instead of a consistent, controlled Java source & target version.
This causes compatibility issues when building with newer JDKs.
Current behavior
When building the java bindings with CMake using JDK 25 for example, the resulting com.microsoft.z3.jar contains Java 25 bytecode.
Expected behavior
Java bindings should compile with consistent source/target compatibility regardless of build JDK version and build system
Root Cause
No -source or -target compile flags are specified in the CMake build, while the python script generating the Makefile specifies -source 1.8 -target 1.8.
Problem
The CMake build system compiles the Java bindings with the JDK version of the build environment as target instead of a consistent, controlled Java source & target version.
This causes compatibility issues when building with newer JDKs.
Current behavior
When building the java bindings with CMake using JDK 25 for example, the resulting com.microsoft.z3.jar contains Java 25 bytecode.
Expected behavior
Java bindings should compile with consistent source/target compatibility regardless of build JDK version and build system
Root Cause
No -source or -target compile flags are specified in the CMake build, while the python script generating the Makefile specifies -source 1.8 -target 1.8.