Android - gradlew file seems to be changed with --illegal-access=permit parameter

Hey

We have troubles with the gradlew file in an Android project.

It seems like the gradlew file is changed with an extra --illegal-access=permit parameter.
This parameter is not recognized by our Java JDK, so we are unable to perform any gradlew tasks.

Does anybody have a clue who or why the gradlew file seems to be changed.
I searched in the Github source code and I didn’t find this parameter in the gradle code.

This is an extract of the changed gradlew file.

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS --illegal-access=permit $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
  cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"

Kind regards
Pieter

Did someone in your organization commit that change? I just generated a fresh wrapper using Gradle 7.1.1 and here’s the last few lines I got:

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

exec "$JAVACMD" "$@"

Hey Chris

No one of our orginization did change it.
I am looking what or who changed it, because I cannot find it in the Gradle source code.

I am suspecting something like the Android Studio, but I find nobody who really knows it.

Kind regards
Pieter