MXMLC and 64bit JRE

感情迁移 提交于 2019-11-27 00:28:29

问题


Are there any workarounds to get the Flex compiler to work with a 64bit JRE? If I use an MXMLC task in an Ant buildfile in Eclipse it works fine but if I try to use MXMLC from the command line (or try the Run... command from FDT in Eclipse) it fails, telling me ...

"Error loading: C:\Program Files\Java\jrrt-1.6.0\jre\bin\jrockit\jvm.dll"

(this is with a 64bit JRockit runtime but that shouldn't matter).


回答1:


There is currently no support for using the Flex compiler with the 64 bit JRE. Instead, have the compiler use a 32 bit JRE.

To do so, you'll need to edit the jvm.config file located in FLEX_HOME\bin. Within jvm.config, set java.home to the location of a 32bit JRE. If you don't already have a 32bit JRE, download it.

Example:

java.home=C:/Program Files (x86)/Java/jre6

If you like this answer, please click the up arrow to the left.




回答2:


You can use any 64 bit Java but you need a batch file instead of the exe file to invoke java without the 32 bit stub. Create the bat files in the flex\bin folder.

mxmlc.bat:

@echo off
for  %%i in (%0) do set FLEX_HOME=%%~dpi..
java -jar "%FLEX_HOME%\lib\mxmlc.jar" +flexlib="%FLEX_HOME%/frameworks" %*

compc.bat:

@echo off
for  %%i in (%0) do set FLEX_HOME=%%~dpi..
java -jar "%FLEX_HOME%\lib\compc.jar" +flexlib="%FLEX_HOME%/frameworks" %*

Rinse and repeat for all other flex *.exe files.

Also add java options as needed, e.g.

java -Xmx2000m -XX:MaxMetaspaceSize=512m -jar "%FLEX_HOME%\lib\... ...

Now use

  • mxmlc.bat instead of mxmlx.exe
  • compc.bat instead of compc.exe
  • ...


来源:https://stackoverflow.com/questions/2955280/mxmlc-and-64bit-jre

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!