Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle sync failed: Unable to make field private static final java.util.Map java.lang.ProcessEnvironment.theCaseInsensitiveEnvironment accessible

I try to build my gradle project and I get the following error:

1:36 PM Gradle sync failed: Unable to make field private static final java.util.Map java.lang.ProcessEnvironment.theCaseInsensitiveEnvironment accessible: module java.base does not "opens java.lang" to unnamed module @7d417077 (5 s 556 ms)

build.gradle file

and no, I do not know gradle and no I am not planning on learning it, but I have no chioce. Thanks in advance

like image 429
Quapi Avatar asked Jan 26 '26 15:01

Quapi


1 Answers

I've had a similar problem with an old BungeeCord plugin, which used Gradle 4.10. In my case - it seems like that old Gradle doesn't work properly with Java 16, so I've manually changed contents of gradle/wrapper/gradle-wrapper.properties file to use Gradle 7.0.

Old file:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip

New file:

distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip

Now it works ok, no more Gradle errors.

like image 105
Kamilkime Avatar answered Jan 28 '26 04:01

Kamilkime



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!