diff options
author | sanjaypujare <sanjaypujare@users.noreply.github.com> | 2023-09-11 13:41:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-11 13:41:50 -0700 |
commit | 923ac604162f94f906c0c7a36821671abbfd9e76 (patch) | |
tree | 22c3b4e0593ee159287261c8f71adf61345a6f9e | |
parent | b839b38b835b76aec31ae3975cded5643e0f35a1 (diff) | |
download | grpc-grpc-java-923ac604162f94f906c0c7a36821671abbfd9e76.tar.gz |
api: don't generate Java7 bytecode with Java 20+ (#10552)
Java 20+ don't support --release 7, so we just will use the default (8).
-rw-r--r-- | api/build.gradle | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/api/build.gradle b/api/build.gradle index 3a77ee243..d3d602b3b 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -17,7 +17,9 @@ sourceSets { } tasks.named("compileContextJava").configure { - if (JavaVersion.current().isJava9Compatible()) { + if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20)) { + println("!!! Javac does not support generating Java 7 bytecode. Do not use for release builds !!!") + } else if (JavaVersion.current().isJava9Compatible()) { options.release = 7 } else { sourceCompatibility = JavaVersion.VERSION_1_7 |