You are here

Setting MAVEN_OPTS

Before using the Alfresco SDK, you need to set your MAVEN_OPTS environment variable to a suitable value using the correct mechanism for your operating system.
Setting the MAVEN_OPTS environment variable ensures that adequate memory is available to run Alfresco and your applications built with the Alfresco SDK.
  1. On Mac OS X you can edit your .bash_profile file and add the following:

    export MAVEN_OPTS="-Xms1024m -Xmx4096m -XX:PermSize=1024m"

    Restart the terminal session or run source .bash_profile to activate the environment variable.

  2. On Linux you can edit your .bashrc file and add the following:

                            
    export MAVEN_OPTS="-Xms1024m -Xmx4096m -XX:PermSize=1024m"
                            
                            
    CAUTION:
    This does not configure Spring Loaded. You will see how to install and configure Spring Loaded later.

    Restart the terminal session or run source .bashrc to activate the environment variable.

  3. On Windows, the exact procedure for setting environment variables varies depending on the version of Windows you are running. For example, the procedure for Windows XP can be found in the Microsoft Knowledgebase.
  4. Ensure that the MAVEN_OPTS environment variable is set correctly, using a method suitable for your system. For example, on Mac OS X and Linux you can enter the following command:

                            
    env | grep MAVEN         
                            
                        

    Ensure that the result matches the value you specified in your shell configuration file (such as .bashrc.

    If you are on Windows you can use a command such as SET M to display environment variables starting with 'M'.

Your MAVEN_OPTS environment variable is now set. Feel free to increase the specified values if required, for example, if you get "out of memory" errors when running your projects.

Sending feedback to the Alfresco documentation team

You don't appear to have JavaScript enabled in your browser. With JavaScript enabled, you can provide feedback to us using our simple form. Here are some instructions on how to enable JavaScript in your web browser.