Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Mon, 28 Apr 2025 14:56:46 +0000 Subject: Re: [pgjdbc/pgjdbc] PR #3607: Copr: Use Java 21 as the build dependency In-Reply-To: References: List-Id: X-GitHub-Author-Login: vlsi X-GitHub-Comment-Id: 2835535304 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 3607 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3607#issuecomment-2835535304 Content-Type: text/plain; charset=utf-8 This is funny and not so funny at the same time: ``` * What went wrong: Execution failed for task ':postgresql:compileJava'. > Compilation failed; see the compiler output below. warning: [options] source value 8 is obsolete and will be removed in a future release warning: [options] target value 8 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. error: warnings found and -Werror specified ``` @mkoncek , could you add the following as well? ```diff --- a/build-logic/jvm/src/main/kotlin/build-logic.java.gradle.kts +++ b/build-logic/jvm/src/main/kotlin/build-logic.java.gradle.kts @@ -62,6 +62,11 @@ tasks.configureEach { } } ) + if (buildParameters.jdkBuildVersion >= 21 && buildParameters.targetJavaVersion < 11) { + // We know target Java 8 is deprecated with Java 21, so silence the warning + // otherwise the build fails due to -Werror below + compilerArgs.add("-Xlint:-options") + } if (!buildParameters.enableCheckerframework) { compilerArgs.add("-Xlint:deprecation") } else { ```