diff --git a/buildSrc/src/main/groovy/io.deephaven.java-toolchain-conventions.gradle b/buildSrc/src/main/groovy/io.deephaven.java-toolchain-conventions.gradle index 2a1322225bc..6c2f2a91fb5 100644 --- a/buildSrc/src/main/groovy/io.deephaven.java-toolchain-conventions.gradle +++ b/buildSrc/src/main/groovy/io.deephaven.java-toolchain-conventions.gradle @@ -4,15 +4,15 @@ plugins { id 'java' } -def compilerVersion = Integer.parseInt((String)project.findProperty('compilerVersion') ?: '11') +def compilerVersion = Integer.parseInt((String)project.findProperty('compilerVersion') ?: '21') def compilerVendor = project.hasProperty('compilerVendor') ? JvmVendorSpec.matching((String)project.property('compilerVendor')): null def languageLevel = Integer.parseInt((String)project.findProperty('languageLevel') ?: '11') -def runtimeVersion = Integer.parseInt((String)project.findProperty('runtimeVersion') ?: '11') +def runtimeVersion = Integer.parseInt((String)project.findProperty('runtimeVersion') ?: '21') def runtimeVendor = project.hasProperty('runtimeVendor') ? JvmVendorSpec.matching((String)project.property('runtimeVendor')): null def testLanguageLevel = Integer.parseInt((String)project.findProperty('testLanguageLevel') ?: '11') -def testRuntimeVersion = Integer.parseInt((String)project.findProperty('testRuntimeVersion') ?: '11') +def testRuntimeVersion = Integer.parseInt((String)project.findProperty('testRuntimeVersion') ?: '21') def testRuntimeVendor = project.hasProperty('testRuntimeVendor') ? JvmVendorSpec.matching((String)project.property('testRuntimeVendor')): null if (languageLevel > compilerVersion) { @@ -82,10 +82,14 @@ tasks.withType(JavaCompile).configureEach { if (name == 'compileTestJava') { if (compilerVersion != testLanguageLevel) { options.release.set testLanguageLevel + sourceCompatibility = testLanguageLevel + targetCompatibility = testLanguageLevel } } else { if (compilerVersion != languageLevel) { options.release.set languageLevel + sourceCompatibility = languageLevel + targetCompatibility = languageLevel } } } diff --git a/clock-impl/build.gradle b/clock-impl/build.gradle index b7af62787ed..06e5a378705 100644 --- a/clock-impl/build.gradle +++ b/clock-impl/build.gradle @@ -12,8 +12,10 @@ dependencies { tasks.withType(JavaCompile).configureEach { options.compilerArgs += ['--add-exports', 'java.base/jdk.internal.misc=ALL-UNNAMED'] - // Explicitly set the source compatibility so gradle will invoke javac with `-source 11` instead of `--release` - sourceCompatibility = 11 + // Explicitly unset release so gradle will invoke javac with `-source -target ` + // instead of `--release `, which would otherwise produce + // > error: exporting a package from system module java.base is not allowed with --release + options.release.unset() } tasks.withType(Javadoc).configureEach { diff --git a/hotspot-impl/build.gradle b/hotspot-impl/build.gradle index 65562498d26..006834795e4 100644 --- a/hotspot-impl/build.gradle +++ b/hotspot-impl/build.gradle @@ -12,8 +12,10 @@ dependencies { tasks.withType(JavaCompile).configureEach { options.compilerArgs += ['--add-exports', 'java.management/sun.management=ALL-UNNAMED'] - // Explicitly set the source compatibility so gradle will invoke javac with `-source 11` instead of `--release` - sourceCompatibility = 11 + // Explicitly unset release so gradle will invoke javac with `-source -target ` + // instead of `--release `, which would otherwise produce + // > error: exporting a package from system module java.management is not allowed with --release + options.release.unset() } tasks.withType(Javadoc).configureEach {