您的位置:首页 > 编程语言 > Java开发

Error: Could not create the Java Virtual Machine.

2014-05-07 13:25 567 查看
最近使用Android Studio开发Android应用时,将studio更新到最新版后,就出错了。出错信息如下:



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.11/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.

在网上找了很久,且最近看了本关于JVM的书,终于弄明白了点,找到了解决办法。

开发环境:(32位)win7旗舰版 ;内存3G ;JDK1.7 ;JVM是HotSpot。(win+R -> cmd ->java -version会显示出jdk版本和jvm的信息)

主要是因为jvm无法无法向系统申请到想要的内存(可能是连续的内存吧)。

开始用这软件的时候,一切配置都是默认的。在StackOverFlow网站上找到了一篇说到的,将VM Options那里写上java虚拟机参数(我的设为-Xmx512m)。

(Android Studio上的设置方法:Ctrl+Alt+S,左边Project Settings下的Compiler -> Gradle -> VM Options 那一栏填上合适的参数。

网上搜索下HotSpot虚拟机的参数设置)

这个方法并不是万能的,将参数设小点容易成功。比如 -Xmx64m 。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐