我如何获得m2eclipse来识别$ M2_OPTS? [英] How do I get m2eclipse to recognize $M2_OPTS?
问题描述
看来m2eclipse无法识别我的$ M2_OPTS变量.
It appears m2eclipse is not recognizing my $M2_OPTS variable.
我可以在eclipse fine之外运行相同的构建(使用增大的heapsize):
I can run the same build outside of eclipse fine (with cranked up heapsize):
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51 seconds
[INFO] Finished at: Tue Nov 10 00:00:02 EST 2009
[INFO] Final Memory: 72M/187M
[INFO] ------------------------------------------------------------------------
但是当我使用m2eclipse运行它时,我总是用光内存:
But when I run this with m2eclipse I always run out of memory:
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Java heap space
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.OutOfMemoryError: Java heap space
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
...
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 27 seconds
[INFO] Finished at: Mon Nov 09 23:56:32 EST 2009
[INFO] Final Memory: 43M/81M
[INFO] ------------------------------------------------------------------------
有什么想法吗?
解决方案:将mem args添加到Java首选项的Installed JREs标签中.
SOLUTION : Add the mem args to the Installed JREs tab of the Java preferences.
推荐答案
There is currently an issue about this, see MNGECLIPSE-1182, and a workaround:
...您可以在窗口"/首选项"/"Java"/已安装的JRE"中指定默认的JVM参数.
... you can specify default JVM arguments in Window / Preferences / Java / Installed JREs.
但实际上,此评论使我感到困惑:
But actually, this comment is confusing me:
[似乎当前 m2eclipse插件仍然很荣幸
M2_OPTS
环境变量何时 使用外部Maven安装.
[ It appears as though the current m2eclipse plugin still honors the
M2_OPTS
environment variable when using an external maven installation.
所以我只定义了两个:
MAVEN_OPTS
用于从中运行mvn
命令提示符和M2_OPTS
从m2eclipse运行Maven.例如.放
M2_OPTS=-Xmx256M -XX:MaxPermSize=128M
So I just defined both of them:
MAVEN_OPTS
for running mvn
from
command prompts and M2_OPTS
for
running maven from m2eclipse. E.g. set
M2_OPTS=-Xmx256M -XX:MaxPermSize=128M
我正在使用Maven 2.1.0和Maven 集成Eclipse版本 0.9.9.200907071528和Eclipse Galileo. ]
I'm using Maven 2.1.0 and Maven Integration for Eclipse version 0.9.9.200907071528 with Eclipse Galileo. ]
这篇关于我如何获得m2eclipse来识别$ M2_OPTS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!