Maven heap space

后端 未结 2 809
我在风中等你
我在风中等你 2021-01-02 17:42

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.

相关标签:
2条回答
  • 2021-01-02 17:53

    When I am running mvn clean install for my build on linux RHEL 6 it is showing java.lang.outOfMemoryError heap space.

    You need to set the MAVEN_OPTS environment variable.

    I have read all the articles on internet

    That is false. At best you have read a TINY FRACTION of the relevant articles.

    ... and in my machine I don't have mvn.sh, I have mvn.bat

    If you have used "yum" to install Maven, then there will be a "mvn" command on your command path. On my system, it is a shell script. If you were going to "hack" a script, that would what you would edit.

    But you shouldn't need to.

    and where to set export MAVEN_OPTS COMMAND.

    This is a very basic "How to use a Linux command shell" question.

    The answer is either you type is at the command prompt before you run the "mvn" command, or you add it to your shell initialization file and restart the shell as appropriate.


    My advice would be to invest some time in reading a tutorial about how to use the Linux command shell. It will save you a lot of time in the long term.

    0 讨论(0)
  • 2021-01-02 18:02

    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"
    

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

    0 讨论(0)
提交回复
热议问题