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
.
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
.
Where can I set the export MAVEN_OPTS command?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With