我对我的play项目做了一些修改,当我尝试运行它时,我得到了错误。
>play run
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 occured. Program will exit.这是一个常见的问题吗?我对play框架相当缺乏经验,但我之前已经运行过我的项目几次,都没有遇到这个错误。
编辑:有关java版本的信息。
>java -version
java version "1.7.0_11"
Java(TM) Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) Client VM (build 23.6-b04, mixed mode, sharing)发布于 2013-08-29 13:29:02
在Play framework 2.0.3,<play framework install dir>\framework\build.bat脚本中,您需要替换以下命令的命令行参数
java -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\repository" -Dplay.home="%~dp0." -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\sbt-launch.jar" %*转到
java -XX:+CMSClassUnloadingEnabled %DEBUG_PARAM% -Dfile.encoding=UTF8 -Dplay.version="%PLAY_VERSION%" -Dsbt.ivy.home="%~dp0..\repository" -Dplay.home="%~dp0." -Dsbt.boot.properties="file:///%p%sbt/sbt.boot.properties" -jar "%~dp0sbt\sbt-launch.jar" %*它解决了我的问题。
有关更多信息,请参阅this post。
https://stackoverflow.com/questions/14649517
复制相似问题