StartScripts : Use environment variables in defaultJvmOpts

Hello team,
I was using Gradle 7.1.1 to define defaultJvmOpts using environment variables ($APP_HOME) but while upgrading to Gradle 7.5.1, this is no longer expanded.
I am doing something like this :

defaultJvmOpts = '-Dlog4j.configurationFile=CUSTOM_APP_HOME/config/log4j2.xml'

and replacing CUSTOM_APP_HOME with $APP_HOME in doLast , it was working fine with 7.1.1 , but with the upgrade it fails to do so.

Is there any recommendation to use that environment variable inside DEFAULT_JVM_OPTS ?

Thanks in advance

The old start script templates allowed some remote code execution and thus were vulnerable.
They were “improved” to disallow that, which also means that the environment variables do not work like that anymore.
You could use your own start script templates that allow it though.