This week, I wanted to use Ant to compile a large project with a couple external libraries. Right after a few seconds of running my build.xml using Ant, I received this ugly message:
compile flex project:
[mxmlc] Loading configuration file C:\Program Files\Adobe\Flex Builder 3\sdks\3.3.0\frameworks\flex-config.xml
[mxmlc] Error: Java heap space
[mxmlc] java.lang.OutOfMemoryError: Java heap space
......
BUILD FAILED
Boooooo!
After consulting a couple of documents and search google, I found a solution that I decided to share. A lot of documentation states that you should change or add the environment variable ANT_OPTS to the particular size (Windows). This didn't work for me. The solution involves changing a particular property in Flex Builder. I really should thank Eric Fickes for his blog on this issue on Mac. My solution is for Windows.
Go to Window --> Preferences
From the menu select Java -->Installed JREs

Select the VM and click the edit button. In "Default VM Arguments" enter "-Xmx512m" without quotes. This value may vary as well as performance.

Hopefully this makes your life a little easier.
[...] This week, I wanted to use Ant to compile a large project with a couple external libraries. Right after a few seconds of running my build.xml using Ant, I received this ugly message: compile flex project: [mxmlc] Loading configuration file C:Program FilesAdobeFlex Builder 3sdks3.3.0frameworksflex-config.xml [mxmlc] Error: Java heap space [mxmlc] java.lang.OutOfMemoryError: Java heap space …… Here is the original: Ant Compiling in Flex Builder “Error: Java heap space” [...]
[...] This post was Twitted by CreativeTweet [...]
nice one, :)
but worth noting that this works only with eclipse integrated ant, it will not affect external ant,
I personally use ant outside of eclipse from command line, it seems to run lot faster too .
great find.
“You can also get around this issue by running ant in the eclipse runtime instead of a separate runtime. It’s an option when you select your script and choose “Run as Ant…”.
By
Christopher Huyler Senior Software Engineer at LeapFrogRx
Thanks for the shout out Dennis.
Worked for me! Thanks for sharing this solution.
Hey, I am not seeing the Java or JSEclipse directories in Flex Builder, I’ve set everything up to, any ideas?
You can also create a new Environment Variable
Variable: ANT_OPTS
Value: -XX:MaxPermSize=128M -Xmx1024M
Here is a link with details:
http://www.ditainfocenter.com/eclipsehelp/index.jsp?topic=/ditaotug_top/installing/windows_settingenvvariables.html
Good Solution