Maven堆空间 [英] Maven heap space

查看:185
本文介绍了Maven堆空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Linux RHEL 6上运行 mvn clean install 时,我收到以下错误: java.lang.outOfMemoryError堆空间

When I am running mvn clean install for my build on linux RHEL 6. I'm getting the following error: java.lang.outOfMemoryError heap space.

我已经阅读了互联网上的所有文章。在我的机器上,我没有名为 mvn.sh 的文件,我只有一个文件 mvn.bat

I have read all the articles on internet. On my machine I dont have a file called mvn.sh, I only have a file mvn.bat.

我在哪里可以设置导出MAVEN_OPTS命令?

Where can I set the export MAVEN_OPTS command?

推荐答案

你可以运行 mvn 命令,所以你无关紧要的是使用 .sh .bat 文件。为了将来参考,您应该记住,.bat文件适用于Windows,而不适用于Linux。无论如何,在运行mvn命令的同一shell中,首先执行此操作:

You can run the mvn command, so its irrelevant wether you are using a .sh or .bat file. For future reference you should keep in mind though that .bat files are for Windows, not Linux. Anyway, in the same shell you are running your mvn command in, do this first:

export MAVEN_OPTS="-Xmx512M"

然后执行 mvn 命令。如果你的内存不足,请将数字提高。

Then execute your mvn command. Bump the number up if you still run out of memory.

这篇关于Maven堆空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆