Unable to get mutable Windows environment variable map Run with --scan to get full insights. Unable to get mutable Windows environment variable map When trying to run gradlew build in a minecraft forge project, I get: I'm … If you get "command not found: gradle", you need to ensure that Gradle is properly added to your PATH. If you get something like: ERROR: JAVA_HOME is set to an invalid directory Please set the JAVA_HOME variable in your environment to match the location of your Java installation. The gradle executable is usually installed here (when installed by Android-Studio): **.gradle\wrapper\dists\gradle--bins\\gradle- \bin** , refers to the user directory, eg. C:Users/myuser , refers to installed gradle version number like 4.4 or 4.4.1 etc * Get more help at https://help.gradle.org Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm) * What went wrong: Unable to get mutable Windows environment variable map * Try: Run with --stacktrace option to get the stack trace. Try: Run with --info or --debug option to get more log output. Try: Run with --stacktrace option to get the stack trace. * What went wrong: Unable to get mutable Windows environment variable map * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm) * Get more help at https://help.gradle.org. Run with --info or --debug option to get more log output. Unable to get mutable Windows environment variable map FAILURE: Build failed with an exception. $ ./gradlew wrapper --gradle-version 7.0.2 FAILURE: Build failed with an exception.