Unrecognized JVM option for [--add-opens] , Gradle 6 and JDK11

Gradle process is not able to launch JVM with following VM args. Please help if there is a fix for this problem.

application {
    applicationDefaultJvmArgs = ["--add-opens java.base/jdk.internal.loader=ALL-UNNAMED"]
    mainClassName = 'com.gradle.jvmargs.MainTestClass'
}

ERROR LOGS:

Starting process ‘command ‘/usr/lib/jvm/java-11-openjdk-amd64/bin/java’’. Working directory: /home/sumitk/IdeaProjects/GradleJVMArgs Command: /usr/lib/jvm/java-11-openjdk-amd64/bin/java --add-opens java.base/jdk.internal.loader=ALL-UNNAMED -Dfile.encoding=UTF-8 -Duser.country=IN -Duser.language=en -Duser.variant -cp /home/sumitk/IdeaProjects/GradleJVMArgs/build/classes/java/main:/home/sumitk/IdeaProjects/GradleJVMArgs/build/classes/groovy/main:/home/sumitk/IdeaProjects/GradleJVMArgs/build/resources/main:/home/sumitk/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.3.11/f6b34997d04c1538ce451d3955298f46fdb4dbd4/groovy-all-2.3.11.jar com.gradle.jvmargs.MainTestClass
Successfully started process ‘command ‘/usr/lib/jvm/java-11-openjdk-amd64/bin/java’’
Unrecognized option: --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
:run (Thread[Execution worker for ‘:’,5,main]) completed. Took 0.015 secs.

The command shown in the log works perfectly if i run directly through command prompt. JVM get launched successfully with right VM parameter.

Following are the environment details:


Gradle 6.0.1

Build time: 2019-11-18 20:25:01 UTC
Revision: fad121066a68c4701acd362daf4287a7c309a0f5

Kotlin: 1.3.50
Groovy: 2.5.8
Ant: Apache Ant™ version 1.10.7 compiled on September 1 2019
JVM: 11.0.5 (Private Build 11.0.5+10-post-Ubuntu-0ubuntu1.1)
OS: Linux 5.3.0-24-generic amd64

You added a single option. Try with:

applicationDefaultJvmArgs = ["--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED"]

Thanks a lot. This is perfect.