delta-io / delta

An open-source storage framework that enables building a Lakehouse architecture with compute engines including Spark, PrestoDB, Flink, Trino, and Hive and APIs
https://delta.io
Apache License 2.0
7.18k stars 1.62k forks source link

[Build] Use `--release` instead of `--source` and `--target` #3104

Closed vkorukanti closed 1 month ago

vkorukanti commented 1 month ago

Description

Currently, we are using --target and --source to set the target JVM version, but it is known to cause issues when the jars are built using JDK17 to generate bytecode that is runnable using JVM 1.8 and above. See here for an example. Instead, use --release to generate the useable byte code in JVM 1.8 and above.

Quote from blog:

In contrast to the more widely known pair of—-source and—-target, the—-release switch will ensure that only byte code is produced that is actually usable with the specified Java version.

How was this patch tested?