-Djava.awt.headless=true
to VMARGS. This solved that issue, but didn't make it compile much faster.
Then, after a bit of fiddling around, it turned out that putting java into 32bit mode:
-d32
fixed the problem! The difference was significant. I tested this in 2 different apps. For App 1, it took 45 seconds to compile on 64bit mode, only 9 seconds on 32bit mode. For App 2, it took 30 seconds on 64bit mode, only 7 seconds on 32bit mode. So, mxmlc performs 4-5 times slower on 64bit java than 32bit, java. Why would this be the case, I have no idea. If anyone has an idea, I'd love to be enlightened. If you come across this problem, the fix is to open up mxmlc, and edit the line that says:
VMARGS="-Xmx1024m -Dsun.io.useCanonCaches=false"
and change it to:
VMARGS="-Xmx1024m -Dsun.io.useCanonCaches=false -Djava.awt.headless=true -d32"
I hope that helps someone.
