Skip to content

Commit

Permalink
api: don't generate Java7 bytecode with Java 20+ (grpc#10552)
Browse files Browse the repository at this point in the history
Java 20+ don't support --release 7, so we just will use the default (8).
  • Loading branch information
sanjaypujare authored Sep 11, 2023
1 parent b839b38 commit 923ac60
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 923ac60

Please sign in to comment.