Skip to content

Commit c83c03f

Browse files
authored
Build Java9+ sources with any compatibile JDK (#304)
1 parent bceda2c commit c83c03f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ddprof-lib/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,13 @@ sourceSets {
256256
}
257257
}
258258

259+
def current = JavaVersion.current().majorVersion.toInteger()
260+
def requested = current >= 11 ? current : 11
261+
259262
// Configure Java 9 compilation with Java 11 toolchain
260263
tasks.named('compileJava9Java') {
261264
javaCompiler = javaToolchains.compilerFor {
262-
languageVersion = JavaLanguageVersion.of(11)
265+
languageVersion = JavaLanguageVersion.of(requested)
263266
}
264267
options.release = 9
265268

0 commit comments

Comments
 (0)