Skip to content

CMake build system compiles Java bindings with inconsistent Java source & target version #8111

@bu99ed

Description

@bu99ed

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions