执行 ant
之一任务,启动 mxmlc
(反过来使用JVM)。我得到以下输出:
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.
通过谷歌搜索错误消息,我意识到 jvm 的堆大小设置不正确。试图通过
grep
检查我的环境变量-ing "384"或 "java"但一无所获。这些参数是从哪里获取的?
最佳答案
数字来自于 mxmlc 脚本本身(mxmlc 实际上是一个 shell 脚本):
# 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" "$@"
我不确定为什么你会得到无效的最大堆大小。看起来好像整个 $VMARGS 变量都作为单个变量传入。你用的是什么外壳?
关于java - 无效的堆大小 : where it is taken from?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6585330/