0

I know this has been asked multiple times before, but no solution worked so far in my case.

Situation: I'm trying to build a Maven project. The environment is JDK 1.7 on Eclipse.

Problem: Upon running a Maven build, I get the following error:

java.lang.OutOfMemoryError: Java heap space

What I've tried : In my pom.xml I tried from other StackOverFlow answers:

                        <fork>true</fork>
                        <meminitial>512m</meminitial>
                        <maxmem>1048m</maxmem>
                        <verbose>true</verbose>
                        <argLine>-Xmx1024m</argLine>

I also changed the memory settings in eclipse.ini

Any help will be greatly appreciated.

4

2 回答 2

2

如果您在 Linux 机器上尝试此操作,请将 MAVEN_OPTS 设置如下并查看。

导出 MAVEN_OPTS="-Xms1024m -Xmx4096m -XX:PermSize=1024m"

于 2020-02-06T08:57:38.687 回答
1

@tagellei 给出了正确答案(在评论部分)。谢谢@tagellei

右键单击项目 --> 运行方式 --> 运行配置 --> 在弹出窗口中单击 JRE 选项卡 --> 在 VM 参数下,键入:-Xms512M -Xmx1024M

于 2020-02-06T09:07:51.790 回答