1

Executing one of the ant tasks, which launches mxmlc (which in turn uses JVM). I am getting the following output:

build-swf:
     [exec] Current OS is Linux
     [exec] Executing '/usr/local/flex_sdk_3/bin/mxmlc' with arguments:
     [exec] '/home/user/dev/branch/flash/FLA/layer.as'
     [exec] '-output'
     [exec] '/home/user/dev/branch/flash/bin-release/layer.swf'
     [exec] '-compiler.source-path'
     [exec] '/home/user/dev/branch/flash/FLA'
     [exec] '-compiler.library-path'
     [exec] '/usr/local/flex_sdk_3/frameworks/libs'
     [exec] '-default-background-color=0xFFFFFF'
     [exec] '-locale'
     [exec] 'en_US'
     [exec] '-compiler.library-path'
     [exec] '/usr/local/flex_sdk_3/frameworks/locale/en_US'
     [exec] '-incremental'
     [exec] '-optimize=true'
     [exec] '-target-player=10'
     [exec] '-use-network=true'
     [exec] '-warnings=false'
     [exec] '-define=CONFIG::commercial,false'
     [exec] 
     [exec] The ' characters around the executable and arguments are
     [exec] not part of the command.
     [exec] Invalid maximum heap size: -Xmx384m -Dsun.io.useCanonCaches=false
     [exec] Could not create the Java virtual machine.

By googling on the error message, I've realized that the heap size for the jvm was not set correctly. Tried to examine my environment variables by grep-ing "384" or "java" but got nothing. Where are those parameters taken from?

BreakPhreak
  • 10,940
  • 26
  • 72
  • 108

1 Answers1

1

The number comes from the mxmlc script itself (mxmlc is actually a shell script):

# don't use $FLEX_HOME in this variable because it may contain spaces,
# instead put it on the java args directly, with double-quotes around it
VMARGS="-Xmx384m -Dsun.io.useCanonCaches=false"

java $VMARGS -jar "$FLEX_HOME/lib/mxmlc.jar" +flexlib="$FLEX_HOME/frameworks" "$@"

I'm not sure why you'd get invalid maximum heap size. It appears as if the entire $VMARGS variable is getting passed in as a single variable. What kind of shell are you using?

Pace
  • 41,875
  • 13
  • 113
  • 156
  • I've found that this line in `.bashrc` was a problem: `export IFS=$(echo -en "\n\b") # file separtor for the for loop`. However, have no clue on what does it mean. Accepting the answer meanwhile (thanks for guiding me out of a problem). If you have anything to say about the `IFS` - please share. – BreakPhreak Jul 06 '11 at 07:18
  • 2
    The IFS is how bash recognizes word boundaries. By default, it is any whitespace. In other words, -Xmx384m -Dsun.io.useCanonCaches=false would be two different arguments. When the IFS is changed to newlines (as that line was doing) then -Xmx384m -Dsun.io.useCanonCaches=false is one word since there is no IFS between them. In general if the IFS is ever modified it should be restored to its old value after the modification. – Pace Jul 06 '11 at 16:42
  • Holy shit this thread just saved my life. I couldn't find out for the life of me why my java arguments weren't being parsed correctly when initiated from a bash script. Turns out the IFS was being set to join off of | and \n earlier in the script, all I had to do was reset it and everything worked. – Brian Smith Jun 22 '22 at 19:01