Ionic gradle编译无法初始化jvm 提示unrecognized jvm option is used

发布于 4 年前 作者 yibo5220 4652 次浏览 最后一次编辑是 4 年前 来自 分享

gradle编译无法初始化jvm 提示 unrecognized jvm option is used如何解决

用gradle编译ionic程序时,报以下错误:

Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/1.12/userguide/gradle_daemon.html
Please read below process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit

2.png

解决方案

在个人文件夹( (C:\Users\username.gradle 或 ~.gradle))下创建gradle.properties文件,添加

org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m

如果以前有org.gradle.jvmargs 替换以前的

注:可根据自己的需要设置jvm参数-Xmx的大小

jvm配置相关链接:https://docs.gradle.org/current/userguide/build_environment.html

回到顶部