After changing the Java version to 17 I can't build the Gradle project.

I am using Gradle 7.3.1 version and have the following line in Gradle properties:

org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xms1g -Xmx4g -XX:+UseG1GC -XX:+CMSClassUnloadingEnabled 

then I got the following error

Unrecognized VM option 'CMSClassUnloadingEnabled' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. 

If I remove -XX:+CMSClassUnloadingEnabled then I got this error:

Unable to make field private int java.lang.reflect.Field.modifiers accessible: module java.base does not "opens java.lang.reflect" to unnamed module @1b9ee3e0 
4

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy