Set MAVEN_OPTS For All Terminal Sessions


I was just exporting the MAVEN_OPTS var before I ran any maven command, but then I decided to just stick it in my terminal session’s profile (thanks to quick tip from my buddy Jon Marston) — you can do this 2 ways on your mac:

1) Open Profile in Finder

  1. Open Finder
  2. Locate and open the file /etc/profile — that’s in your root hard drive, in the folder etc.
  3. At the end of the file, drop in the following line:

    export MAVEN_OPTS=-Xmx1024m

2) Open Terminal and Edit the Profile

  1. Open Terminal
  2. Enter in the following command:

    sudo nano /etc/profile

    This basically says that as a super user I want to edit the profile file in a poor man’s vi-like text editor — good phrase Marston.

  3. You’ll be asked for the super user’s password — if it’s your box then you know this — enter it and it’ll open profile.
  4. At the end of the file, drop in the following line:

    export MAVEN_OPTS=-Xmx1024m

  5. Hit CTRL + X to exit
  6. It’ll ask if you want to save, so hit Y.

DONE.

Post to Twitter Tweet This Post

  1. No comments yet.
(will not be published)
  1. No trackbacks yet.