Only pass "--illegal-access=deny" up to JDK-15, later versions deprecate the option and default to "deny"

This commit is contained in:
Uwe Schindler 2021-09-22 19:41:59 +02:00
parent ed7fb8dea0
commit fc475360a8
1 changed files with 6 additions and 1 deletions

View File

@ -105,7 +105,12 @@ allprojects {
ignoreFailures = resolvedTestOption("tests.haltonfailure").toBoolean() == false ignoreFailures = resolvedTestOption("tests.haltonfailure").toBoolean() == false
jvmArgs Commandline.translateCommandline(resolvedTestOption("tests.jvmargs")) jvmArgs Commandline.translateCommandline(resolvedTestOption("tests.jvmargs"))
jvmArgs '--illegal-access=deny'
// Up to JDK-15 we have to enforce --illegal-access=deny, because we want no code to access
// JDK internals; JDK-16 and later will default to deny, see https://openjdk.java.net/jeps/396:
if (rootProject.runtimeJavaVersion < JavaVersion.VERSION_16) {
jvmArgs '--illegal-access=deny'
}
systemProperty 'java.util.logging.config.file', file("${resources}/logging.properties") systemProperty 'java.util.logging.config.file', file("${resources}/logging.properties")
systemProperty 'java.awt.headless', 'true' systemProperty 'java.awt.headless', 'true'