设置MAVEN_OPTS的推荐方法
运行mvn eclipse:eclipse时,经常会出现因为maven项目过大,导致内存不足java栈溢出的error,需要更改MAVEN启动内存
http://stackoverflow.com/questions/2819853/setting-java-heap-space-under-maven-2-on-windows
To set MAVEN_OPTS under Windows 7:
- Right click on My Computer and select Properties (keyboard shortcut press Windows + Pause/Break)
- Click the Advanced System Settings link located in the left navigation of System Properties to display the Advanced System Properties
- Go to the Advanced tab and click the Environment Variables button located at the bottom of the Advanced System Properties configuration window
- Create a New user variable, set the Variable name to MAVEN_OPTS and set the Variable value to
-Xmx1024m
(or more)
Open a new command window and run mvn
.
右键我的电脑,选择属性2 选择 高级系统设置3 在 高级 tab页下,点击环境变量按钮4 创建一个用户变量,变量名是MAVEN_OPTS 值为 -Xms512m -Xmx1024m (or more)