omkreddy commented on code in PR #17426:
URL: https://github.com/apache/kafka/pull/17426#discussion_r1806954054
##########
build.gradle:
##########
@@ -309,25 +304,10 @@ subprojects {
options.compilerArgs << "-Xlint:-serial"
options.compilerArgs << "-Xlint:-try"
options.compilerArgs << "-Werror"
-
- // --release is the recommended way to select the target release, but it's
only supported in Java 9 so we also
- // set --source and --target via `sourceCompatibility` and
`targetCompatibility` a couple of lines below
- if (JavaVersion.current().isJava9Compatible())
- options.release = minJavaVersion
- // --source/--target 8 is deprecated in Java 20, suppress warning until
Java 8 support is dropped in Kafka 4.0
- if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20))
- options.compilerArgs << "-Xlint:-options"
-
+ options.release = minJavaVersion
addParametersForTests(name, options)
}
- java {
- // We should only set this if Java version is < 9 (--release is
recommended for >= 9), but the Scala plugin for IntelliJ sets
- // `-target` incorrectly if this is unset
- sourceCompatibility = minJavaVersion
- targetCompatibility = minJavaVersion
- }
Review Comment:
@chia7712 @frankvicky looks like this removal of sourceCompatibility,
targetCompatibility Java compile options from build.gradle is not setting the
Scala compile target version correctly. I have prepared a build with JDK17 and
getting UnsupportedClassVersionError for Scala classes while trying to start
with JDK 11.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]