Introduction #

This article describes how to set an environment variable, specifically ANT_OPTS.

If you are getting this error:

Please set the environment variable ANT_OPTS to the recommended value of
"-Xmx1024m -XX:MaxPermSize=512m".

It means that your environment variable is not set and that you need to set it.


Windows #

  1. Go into your Control Panel > System > Advanced System Settings > Environment Variables settings
  2. Click "New" in your User Variables
  3. Variable name: "ANT_OPTS"
  4. Variable value: "-Xmx1024m -XX:MaxPermSize=512m"

Setting ANT_OPTS in ant.bat #

  1. Edit the ant.bat file in your ant home folder.
  2. Add the following line at the top of the file:
set ANT_OPTS=-Xmx1024m -XX:MaxPermSize=512m

Ubuntu #

Edit ~/.bashrc or ~/.bash_profile to include:

ANT_OPTS="-Xmx1024m -XX:MaxPermSize=512m"
export ANT_OPTS

Make sure to exit the command prompt to realize the changes.

Mac OS X #



export ANT_OPTS="-Xmx1024m -XX:MaxPermSize=512m"

Related Articles #

Getting started as a Liferay Developer in a few steps

Setting up the Extension Environment

0 Attachments
Average (1 Vote)
The average rating is 5.0 stars out of 5.