Appu Goundan
02/28/2025, 8:19 PM> Configuration cache state could not be cached: field `spec` of `org.gradle.api.internal.tasks.execution.SelfDescribingSpec` bean found in task `:sub-project:compileJava` of type `org.gradle.api.tasks.compile.JavaCompile`: error writing value of type 'org.gradle.api.internal.tasks.compile.CompilerForkUtils$$Lambda$1793/0x00007f840c9dd898'
> Unable to make field private final java.lang.Object[] java.lang.invoke.SerializedLambda.capturedArgs accessible: module java.base does not "opens java.lang.invoke" to unnamed module @6a825622
Appu Goundan
02/28/2025, 8:21 PMVampire
02/28/2025, 11:23 PMAppu Goundan
02/28/2025, 11:28 PMAppu Goundan
04/07/2025, 5:17 PMVampire
04/07/2025, 7:14 PM--add-opens
calls to the daemon JVM args.Alex Semin
04/09/2025, 10:11 AMAppu Goundan
04/09/2025, 2:05 PMVampire
04/09/2025, 2:58 PM--add-opens=java.base/java.net=ALL-UNNAMED
and --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
are missing from the daemon JVM args.
And to me it looks like from a cursory look that this can only happen if Gradle thinks the daemon JVM will be < Java 9 so it does not add the necessary options while then indeed starting a Java 9+ JVM.
When it then tries to serialize the CC state it fails due to the missing arguments.
If you want to do a quick assessment, start you build with --no-daemon --debug
and search for "Using daemon args:" in the output. I assume that there you will find that a Java 9+ is used but the --add-opens
arguments are missing.
You could then set a breakpoint in DefaultDaemonStarter#startDaemon
and check what is happening.
If my guess is right, then the resolvedJava
will be set to a Java 9+ executable while the majorJavaVersion
will be set to <= 8.Appu Goundan
04/13/2025, 5:23 PM