From dcb6742a26bf7383f7bf605e56417a23341c238b Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 27 Jul 2022 09:21:34 +0000 Subject: [PATCH] try to fix jaav 17 build git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903051 13f79535-47bb-0310-9956-ffa450edef68 --- build.gradle | 2 +- poi-examples/build.gradle | 2 +- poi-excelant/build.gradle | 2 +- poi-ooxml-full/build.gradle | 2 +- poi/build.gradle | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index ac1f869fa9..0318f1cba4 100644 --- a/build.gradle +++ b/build.gradle @@ -212,7 +212,7 @@ subprojects { failOnError = true maxMemory = "1024M" javadocTool = javaToolchains.javadocToolFor { - languageVersion = JavaLanguageVersion.of(Math.max(11,jdkVersion)) + languageVersion = JavaLanguageVersion.of(jdkVersion >= 17 ? 17 : 11) } doFirst { diff --git a/poi-examples/build.gradle b/poi-examples/build.gradle index 1e72a8f778..3947004c16 100644 --- a/poi-examples/build.gradle +++ b/poi-examples/build.gradle @@ -59,7 +59,7 @@ task compileJava9(type: JavaCompile) { dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(jdkVersion >= 17 ? 17 : 11) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } diff --git a/poi-excelant/build.gradle b/poi-excelant/build.gradle index 6dac5d9fcb..3d357acc83 100644 --- a/poi-excelant/build.gradle +++ b/poi-excelant/build.gradle @@ -69,7 +69,7 @@ task compileJava9(type: JavaCompile) { dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(jdkVersion >= 17 ? 17 : 11) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } destinationDirectory = file(JAVA9_OUT + VERSIONS9) diff --git a/poi-ooxml-full/build.gradle b/poi-ooxml-full/build.gradle index 79c7ec1a4b..f37056df85 100644 --- a/poi-ooxml-full/build.gradle +++ b/poi-ooxml-full/build.gradle @@ -60,7 +60,7 @@ task compileJava9(type: JavaCompile) { dependsOn 'compileJava' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(jdkVersion) + languageVersion = JavaLanguageVersion.of(jdkVersion >= 17 ? 17 : 11) if (jdkVendor != '') vendor = JvmVendorSpec.matching(jdkVendor) } destinationDirectory = file(JAVA9_OUT + VERSIONS9) diff --git a/poi/build.gradle b/poi/build.gradle index 3516de3966..42ddb9d1fa 100644 --- a/poi/build.gradle +++ b/poi/build.gradle @@ -94,7 +94,7 @@ task compileJava9(type: JavaCompile) { dependsOn 'compileJava' javaCompiler = javaToolchains.compilerFor { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(jdkVersion >= 17 ? 17 : 11) } destinationDirectory = file(JAVA9_OUT + VERSIONS9) source = file(JAVA9_SRC)