如何设置Gradle环境变量?
我正在尝试执行Gradle命令行任务 -setupDecompWorkspace 来设置Minecraft Forge,但是该任务卡在了decompileMC上.我已经尝试过此 issue 的第一个解决方案,但是没有用.第二种解决方案建议将 GRADLE_OPTS
环境变量设置为 -Xmx2G
.我不知道该怎么做.在网上搜索了几个小时后,我仍然找不到答案.即使是正式的Gradle 文档也无济于事.我是否需要在gradle.properties文件中声明变量,将其作为命令行参数或完全不同的方式输入?
I'm trying to execute a Gradle command-line task -setupDecompWorkspace to set up Minecraft Forge, but the task gets stuck on decompileMC. I've tried the first solution from this issue, but it didn't work. The second solution suggest setting the GRADLE_OPTS
environment variable to -Xmx2G
. I don't exactly know how to do this. After searching online for a couple of hours I am still found with no answer. Even the official Gradle documentation doesn't help. Do I need to declare the variable in the gradle.properties file, enter it as a command-line argument or something completely different?
-Xmx2G 是JVM命令行参数,如果要将其设置为Gradle属性,只需将其添加到 gradle.properties 文件:
-Xmx2G is a JVM command line parameter, if you want to set it as a Gradle property just add it to the gradle.properties file in your project root:
org.gradle.jvmargs=-Xmx2G
您还可以在此处找到一些更有用的信息: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
You can also find some more useful information here: https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties