gpt4 book ai didi

maven-2 - 如何让 m2eclipse 识别 $M2_OPTS?

转载 作者:行者123 更新时间:2023-12-04 07:01:52 24 4
gpt4 key购买 nike

看来 m2eclipse 无法识别我的 $M2_OPTS 变量。

我可以在 Eclipse 之外运行相同的构建(使用提高堆大小):

[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 运行它时,我总是内存不足:
[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] ------------------------------------------------------------------------

有任何想法吗?

解决方案:将内存参数添加到 Java 首选项的已安装 JRE 选项卡中。

最佳答案

目前有一个关于此的问题,请参阅 MNGECLIPSE-1182 ,以及解决方法:

... you can specify default JVM arguments in Window / Preferences / Java / Installed JREs.



但实际上,这条评论让我很困惑:

[ It appears as though the current m2eclipse plugin still honors the M2_OPTS environment variable when using an external maven installation.

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

I'm using Maven 2.1.0 and Maven Integration for Eclipse version 0.9.9.200907071528 with Eclipse Galileo. ]

关于maven-2 - 如何让 m2eclipse 识别 $M2_OPTS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1705736/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com