diff --git a/java/build.gradle b/java/build.gradle index 6cc17d82cfe..2ce84edf151 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -31,8 +31,10 @@ subprojects { } // Only enable infer module path with Java 9 and up - java { - modularity.inferModulePath = targetJavaRelease.toInteger() > 8 + if(GradleVersion.current() >= GradleVersion.version('6.4')) { + java { + modularity.inferModulePath = targetJavaRelease.toInteger() > 8 + } } jar {