diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index a3a6b28c1a3b8..552e67ee07ab3 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -947,14 +947,12 @@ class BuildPlugin implements Plugin { '-XX:+HeapDumpOnOutOfMemoryError', "-XX:HeapDumpPath=$heapdumpDir" + jvmArgs System.getProperty('tests.jvm.argline', '').split(" ") + if (project.runtimeJavaVersion >= JavaVersion.VERSION_1_9) { jvmArgs '--illegal-access=warn' } - if (System.getProperty('tests.jvm.argline')) { - jvmArgs System.getProperty('tests.jvm.argline').split(" ") - } - if (Boolean.parseBoolean(System.getProperty('tests.asserts', 'true'))) { jvmArgs '-ea', '-esa' }