How to configure applicationDefaultJvmArguments for Windows?

I’m using the following definition in my subproject:

applicationDefaultJvmArgs = [“-Djava.library.path=APP_HOME/lib”]

Now, the generator for the Windows batch file of the application takes this literally. But because APP_NAME is an environment variable, in the generated script it really should be “%APP_HOME%”.

The problem is: if I use “%APP_HOME%” in my declaration in build.gradle, the result in the batch file is “%%APP_HOME%%”. Thus, the script also will not work.

So now, how can I resolve this problem?