Skip navigation

If you’re using terminal in conjunction with Maven, the easiest way to increase the heap size on your JVM using OS X is as follows:

1) Using Sudo mode, open up you bash profile (mine lives at ‘/etc/profile’)
2) Add “MAVEN_OPTS=’-Xms256M -Xmx512M’; export MAVEN_OPTS;”
3) Save your profile.
4) Open a new shell and ensure the MAVEN_OPTS var exists by using the “set” command and searching for MAVEN_OPTS.
5) Enjoy your java.

Peace!

Advertisements

3 Comments

  1. Hello, I have added the following to profile…
    MAVEN_OPTS=”-Xms256M -Xmx512m”; export MAVEN_OPTS;

    and when I open a new shell I just get…

    -bash: -Xmx512m?: command not found

    and I cannot find it in the set, do you know what may be happening?

    cheers,

    Nikolaus

  2. Thanks you Chad for your help,

    It seems that it is best to copy and paste the code into an editor like pico so that the encoding does not affect it. I used text edit on the first go, without success, so good luck and it seems to have worked great, thanks for the quick fix!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: